![]() |
setlevel2
Her i's my problem, i have a gmap, and i want to use a setlevel2 to warp player on it. But when i tried to warp player on a x that was bigger than 192 or a Y that was bigger than 192, it said "failed", that only happens if i'm not on the gmap, if i am on the gmap, i can warp anywhere on it... So how can i warp a player thats not on the gmap to this gmap on 250,250...?
|
Quote:
|
Argg, i've had another problem...
if (created) { timeout=10; } if (playerchats) { message test; sleep 0.5; message ; } if (timeout) { message hmm; timeout=10; } well i'm kinda new to scripting, and i was messing around with things online, and i tried the previous script, the problem is that, after i touch it, when it sleeps 0.5 seconds, it execute the stuff in the if (timeout) without waiting 10 secondes...why? |
Quote:
|
Try this instead..
NPC Code: ^Now, instead of the npc immediately going from the playerchats to the timeout, it will 'sleep' for 10 seconds then it will execute the timeout. In your case, the number you specify for the timeout doesnt matter, but what matters is the number you specify in the sleep. |
Quote:
I don't think you really understand how scripts work, looking at your explanation. |
Quote:
NPC Code: It is a little more complicated that way; you are basically scripting your own timeout system, but it will let you do what you want without using sleep :) |
Very cool. Use Cheetos's version.
|
Quote:
His problem was that after the sleep it went to the timeout portion. In his script, the timout = # part, basically only set the standards for the if (timeout). The only thing that actually "paused" the script would be the sleep. He wanted his npc to sleep for 10 seconds before performing the timeout, which is what I did with my script. I kept it simple, since what he's trying to do (as in what he wants the npc to do) is simple. In other words, how he had scripted it, he thought that the timeout = # would make the npc "pause" for the amount indicated, but in fact, it didnt matter at all what that number was. What mattered was the number in the sleep. He had sleep 0.5, which is why the npc immediately triggered the timeout right after the sleep. I understand what his problem was (from what he's said). Of course, there is better ways to do it, as indicated by Cheetos, but it doesnt make mines wrong. |
When "sleep" is called then it is using the normal timeout variable, but starts the script execution at one command after the sleep command. So code that follows the after-sleep stuff sees a timeout event too. May be just move the if (timeout) above the if (playerchats) stuff, or better always use timeout and not sleep, and remember in this.mode or so what kind of timeout it is (timeout after creating, timeout after touching).
|
| All times are GMT +2. The time now is 02:55 PM. |
Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.