Author Topic: Is it possible to remove variables from everyone with a single click?  (Read 1023 times)

If not, it's not a big deal. But on this server, there's a voting booth, and it'd be cool if it could only allow for people to vote once per issue. Like, once someone votes they get the "Voted" variable, and then they can't vote again until the votes are cleared. However, I only know how to do it if each person clicks a variable clearer, I'd like it so a single click would do that.

You could make a custom event for it, but other than that I don't think it's possible.

i believe this would require the database events addon, but i think i remember that that was failed

Depending what you have saved from previous times you can try to remove all the text in the folder or certain parts.

Blockland/config/server/VCE/saves.txt 
Thats where all the variables are saved.

Unfortunately, this isn't my server, and I'm not sure the host will be willing to do that as he doesn't particularly like my idea anyway. :I

You could just make completely new variables instead of trying to clear the old ones. You might have to replace a lot of things in the events but it should work.

There is a simple way to do this. Make a baseplate that everyone stands on. When you want to clear the votes, enable the onPlayerTouch event that you have on the baseplate to clear the client's variable.

Add a randomizer and add it to the voting name, this would be the best and perhaps easiest method:

Use the client value voting<var:br:random>. Do that on checks and everything too. Please note that this doesn't work as message or savevariable/loadvaraible, thus, you can't do <var:cl:voting<var:br:random>> or something alike. You'll have to do onActivate Client onVariable voting<var:br:random> if you want to do a check that way.
Make the brick use the next random method every time you set a new vote: set "random" value on the brick to 0 and then random it to something like 100000. Even better if you use decimals too.

Thus, all new voting will use the value "voting2436" "voting216" etc. at random, the chance of two random numbers colliding being very, very small.