Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   NPC Server (https://forums.graalonline.com/forums/forumdisplay.php?f=14)
-   -   sleep (https://forums.graalonline.com/forums/showthread.php?t=18191)

Andor_GP1 11-30-2001 05:12 AM

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?

BocoC 11-30-2001 06:56 AM

Weird... Try to duplicate it in other npc's.

Andor_NPC-Admin1 11-30-2001 06:58 AM

what kind of string are you trying to set?

Jerom 12-04-2001 02:56 AM

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;}

Andor_GP1 12-04-2001 02:59 AM

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!

Andor_NPC-Admin1 12-04-2001 07:35 AM

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.