Aller au contenu

Photo

help with a delay script


  • Veuillez vous connecter pour répondre
2 réponses à ce sujet

#1
Surek

Surek
  • Members
  • 94 messages

I was hoping I could get some help with this, What I would like to do is delay the time between an item can be used. As an example I have an on item activate script that adds a couple of effects to the PC then after they use the item they would have to wait a few minutes before they could use it again.  I know this can be done with variables but I have no idea how to do it.

 

Another way of doing it would be to store the time and then check whether it's been a set amount of time since the last time the item was used. But again not sure how to do that.

 

Any help with this would be appreciated.



#2
Proleric

Proleric
  • Members
  • 2 354 messages
DelayCommand(60.0, ExecuteScript... would run a script after 1 minute to reactivate the item.

Or run every 10 seconds using SendMessageToPC to give feedback on cooldown, e.g. "50 seconds until you can use this again".

Set/GetLocalInt on the item to flag it as unusable, block use in the activate script, and reactivate.

There are other methods, but that will do it.

#3
Surek

Surek
  • Members
  • 94 messages

I figured it out thanks for your help.