Blockland Forums > General Discussion
Help with variable events
Dante77:
I'm trying to make a brick that can't be clicked more than once. (It's a voting system, so it will have 2 bricks: one is yes, the other one is no).
Events:
I know that the error is on event 3 but i don't know how to get rid of it.
Electrk:
You made it so that every time you click it, it sets voted to 0
Try this:
--- Code: ---onActivate > Client > VCE_ifVariable > voted == 1
onVariableTrue > Client > CenterPrint > You already voted
onVariableFalse > Client > VCE_modVariable > voted Set 1
onVariableFalse > etc.
--- End code ---
CheeseDragon:
since a variable always starts at 0 just put at the start of the events Onactivate client vceifvariable == 0 then all the onvariablefalse and true jazz then AFTER that put onactivate client vcemodvariable set 1
get rid of line 3, thats all you have to do
GenaralSkar:
Line 3 causes the variable voted to rest whenever someone clicks on the brick, regardless if they have actually voted or not. So you don't need it.
Port:
Why didn't you use the Events Help topic?