Stoping script
is there a command to make the key commands sleep?
if (keypressed) { if (strequals(#p(1),1)) setani plah,;} is there a way to "freeze" the script so that if I keep tapping 1 it wont restart the gani every time, but rather play it till the end and only then release the key for use? |
If that is the whole script, you can use 'sleep', if not, there are plenty of other ways, using variables.
|
Sleep doesnt work with the keys.
if (keypressed) { if (strequals(#p(1),1)) setani plah,; sleep 3;} If it isnt a continous gani it will restart it when you press during sleep time. I suppose I could do somethign like: if (keypressed && this.keydown=0) { if (strequals(#p(1),1)) {this.keydown=1 setani plah,; sleep 3; this.keydown=0;};} I was just wondering if there was an internal command or something. Speaking of keys how do I use keydown command? if (keydown(A)) { setstring clientr.plahplah,0;} Thats how I understood its used, but that script doesnt do anything. |
Please use [CODE] tags, this way you can organize your posts better.
Quote:
Quote:
According to KSI-GS, rule five: Use '==' when comparing two values for equality. Use '=' when assigning a value to a variable. and you didn't do that, so fix it. Quote:
|
Quote:
Quote:
Key codes for keydown() (ones I know off the top of my head) 0 - Arrow key up 1 - Arrow key left 2 - Arrow key down 3 - Arrow key right 4 - Weapon fire (default: d) 5 - Sword (default: s) 6 - Grab (default: a) 7 - Map (default: m) 9 - Q-Menu (default: q) |
Either check the player's animation before activating the effect, or implement a timer of some kind. Using sleep within a weapon is bad practice.
And keydown is neither a command nor an event. It is a function. |
All times are GMT +2. The time now is 11:50 AM. |
Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.