Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   NPC Scripting (https://forums.graalonline.com/forums/forumdisplay.php?f=8)
-   -   Disabledefmovement (https://forums.graalonline.com/forums/showthread.php?t=54903)

sparkers 08-15-2004 03:16 AM

Disabledefmovement
 
Ok Ive tried using Disabledefmovement in an ocarina wep but it wont work.
And if I do freezeplayer it wont let you play the same note twice.
What shuld I do?

Tolnaftate2004 08-15-2004 04:23 AM

Everytime the loop begins, set the player's gani to something else. I suspect you are using a gani to play the sound.

osrs 08-15-2004 06:11 AM

Try posting a part of the code, things can be solved easily.

sparkers 08-15-2004 04:41 PM

NPC Code:

//#CLIENTSIDE


if (weaponfired) {
disabledefmovement
setani ocarina1,;
timeout=.05;
}

if (timeout) {disabledefmovement;
if (keydown(0)&&!keydown(5)) {setani ocarina-play1,;sleep .1;}
if (keydown(1)&&!keydown(5)) {setani ocarina-play2,;sleep .1;}
if (keydown(2)&&!keydown(5)) {setani ocarina-play3,;sleep .1;}
if (keydown(3)&&!keydown(5)) {setani ocarina-play4,;sleep .1;}
if (keydown(0)&&keydown(5)) {setani ocarina-play5,;sleep .1;}
if (keydown(1)&&keydown(5)) {setani ocarina-play6,;sleep .1;}
if (keydown(2)&&keydown(5)) {setani ocarina-play7,;sleep .1;}
if (keydown(3)&&keydown(5)) {setani ocarina-play8,;sleep .1;}

if (keydown(6)) {enabledefmovement;setani idle,;timeout=0}
if (!keydown(6)) {timeout=.05;}
}


Lance 08-15-2004 06:25 PM

It would totally help if you put a semicolon after disabledefmovement whenever you are using it. Beyond that, freezeplayer while it is playing the note is just fine.

Next, you need to work on your code structure. Do you notice that you are checking if S is down several times? Nest your flag checks, man, and use else when appropriate.

Finally, the board's code tags are pretty useless if you don't even style your code.

As a suggestion: why not use a while loop to ensure that a is held down instead of a timeout loop?


All times are GMT +2. The time now is 09:17 AM.

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.