![]() |
Simple question
Sorry uh.. I just need one simple command for a script i'm working on.. I'll delete this thread as soon as someone replies =)
Anyway, let me think of an example.. Just take like a light switch for an example, I need to figure out how to make it so if the player touches it once it will activate and if it touches it agian it will deactivate. I don't need this script exactly just the idea in general so I could finish up a script I'm working on.. Thanks alot :) |
well, something like this would work, for database npc
NPC Code: then have it read the flag, and if its 1 then on, 0 = off =D |
Um could you explain it a bit?
So I could take it a part, understand how it works, and make it something else.. Please :( |
well, since there is only two possible flags, on or off, i just use variables 0 and 1
take the current status of the light, lets say off (off=0) and then just take the absolute value of the status -1, so 0-1 = -1 |-1| = 1 turns from off (0), to on (1) same way around 1-1 = 0 |0| = 0 turns from on (1), to off (0) |
Just wondering, would that work the same if it was
if (weaponfired) ? |
Quote:
|
it would work in any flag that is true
playerenters, playerchats, etc, etc |
Ahh, thank you :).
|
no problem, thats what im here for
and remember if you have any other questions, dont be afraid to ask |
All times are GMT +2. The time now is 05:23 PM. |
Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.