![]() |
...stumped...
I think its a glitch with graal now, but look. I have this loop, when I use variables it works perfect, but when I use strings (and I have to use strings because regular variables will go to 0 when you leave levels) the while loop doesn't work. Heh, it may be a n00b question, but I don't care. Here it is:
while (!strequals(#v(this.on),#s(mapf))) { this.on=strtofloat(#s(mapf)); } Heh...I'm not going to show the whole script because of the genius calulations and script...but anywho go ahead and make fun of me for not knowing how to fix this simple problem -_-. Tell me how to fix it first though ;) |
Heh forgot to make that blue...
|
if the mapf or whatever is a non-numerical string ur code wont work since vars are numerical..
else u can just use what ur using but switch the 2 and dont use #s() |
Quote:
The only reason I'm using a string is because normal variables are reset when changing levels. Basicly I have a key-combo NPC, this checks which keys are pressed, what order they are pressed, and how long they are pressed. Then you press A, then D it sets a string called mapf, which is basicly on or not. But, for some reason the while loop isn't working, and I can't use timeout for a few reasons. |
i think what you should do, is...
NPC Code: simple fix...right? for some reason, if you did this: NPC Code: it wouldn't work, i think because in order to test something, it has to be a 1 or 0 not a string, strpings always equal 0. i learned that when i jailed every player on doomsday with my jailing system...bad news bear... |
299
|
300
sorry, had to post 300 so i could go to bed....thanks... |
Re: ...stumped...
Quote:
to setstring this.on,strtofloat(#s(mapf)); |
Re: Re: ...stumped...
Quote:
I hope it work:spam: |
Wait, so why a while? It'll only run once anyways, so just use an if..
|
Quote:
What do you mean only once? If's run only once or if in a loop, Whiles run as long as the flag=true. |
Re: ...stumped...
Quote:
|
Try using #v also it may help I dont know why
|
Quote:
while (!strequals(#v(this.on),#s(mapf))) { this.on=strtofloat(#s(mapf)); } after it runs once, this.on gets the value of mapf, and !strequals(#v(this.on),#s(mapf)) becomes false |
But since the value of mapf changes, it becomes true again, in which case the while loop SHOULD continue.
|
Quote:
|
Quote:
|
Quote:
|
| All times are GMT +2. The time now is 04:24 AM. |
Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.