So, I made a voting system using trello api but I having an issue that people can revote and spam the gui to allow double voting. I was wondering if it is possible if I can limit the ammount times someone can vote with in an ammount of days?
The secret of this is that you can create a variable and make equals to false
, then make it true
after the player vote then make it back to false after voting session is finished.
Example:
local voted = false
if voted == false then
--Add 1 vote
end
Yea but if you rejoin, you can still revote. The easiest way is to create a datastore and put the variables you said and every time a player join the game checks the value if he has already voted, if yes then he can’t vote anymore if no then he can still vote. And once he leaves his value sets to true (yes) then the datastore saves it.
or you can create a table that contains players’ names that voted then clear it when voting session is finished. I don’t think that you really need datastore for that.
I mean, It’s better with datastore.
I agree with you. The best method for you, @kapono4466, would be to use a datastore and whenever a player votes, change a variable which will stop them from voting again.
local voted = false -- this would be a reference to your datastore's variable
local function vote()
if not voted then -- if they haven't voted yet or voted = false
voted = true -- you would use your datastore stuff here :SetAsync()
-- do your Trello API stuff here
end
end
Try and work out the rest for yourself, there are some other tutorials on the DevForum which could help you out, but feel free to reply if you have further questions.
I meant to say it single votes but it duplicates it 4 times
meaning that it would move the vote over if the person changes their vote and it takes their roblox player ID and logs it.