Jump to content
  • 0
Svanhild

Quick Question about Timers

Question

So I've been working on this script for 48 hours now and I can't seem to get it right. The problem is that with npc timers, all players are affected. But with player timers, the problem is that, getnpctimer for player timer doesn't seem to work unless it was triggered by an initnpctimer. So my question is, how to read the current timer ticks for a player timer? My purpose is to make a message that would display how many seconds had passed, minute and hour had passed, to make it informative on how much time does the player have left before being warped out of the room.

Share this post


Link to post
Share on other sites

3 answers to this question

Recommended Posts

  • 0

As far as I remember you can't read player's timer, but can't you make a player variable that stores the time when player will be warped?

example, if player will be able to stay in the room for 2 hours, you can do something like:

warpTime = gettimetick(2) + 2 * 3600; // 3600 = 1 hour

Then, if you want to display how much time player still have:

dispbottom "You still have " + (warpTime - gettimetick(2)) + " seconds in this room";

I've not tested it, but I believe it can give you an idea of how to do it.

Share this post


Link to post
Share on other sites
  • 0
Guest

Depending on what you want to do. You could give a rental item with "*rentitem(<item id>, <time>)" and later check if the item is still in the inventory. Well depends on what exactly you want to achieve with your script.

Edited by Guest

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.