![]() |
sleep
i have a script of an npc character that moves around and does things. well whenever i use a sleep command in his script no strings after where i put the sleep command will set, when i take the sleep command back out they all set fine again. Can anyone help me with this?
|
Weird... Try to duplicate it in other npc's.
|
what kind of string are you trying to set?
|
I had a problem with this too.
Say for instance your script was this. if (created){ timeout = 0.05;} if (timeout){ timeout = 0.05; if (playertouchsme){ sleep 2;} If you got stuck on the playertouchsme, and it wouldn't work anymore, try setting the timeout in the command, like this: if (playertouchsme){ sleep 2; timeout = 0.05;} |
ok
if your wondering how this was fixedheres a nifty little trck kitie showed me to fix this. Firsst do somthing like
setstring this.owner,#a; next yo would use get player. you have to do this because while sleeping the npcserver can't write to the player. Thanx Kitie XD! |
yea, that's me =P
When u do if(playertouchsme) on the server sided script of an NPC, it remembers your account name b/c u touched it. Then when u do something like setting a client string, then it sets it for your account. But when u have a sleep somewhere in there, then it forgets your account name b/c its doing timeouts and stuff. So when u set a client string after a sleep, then it doesn't remember the player, and therefore doesn't set the string. So u need to get the player's account name in a string, then do a with(getplayer()) |
| All times are GMT +2. The time now is 07:49 AM. |
Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.