Vote to kick/ban player script help

How do i script it? need some help to make a votekick/ban system, to make my game safer from exploiters.

Every time i join the server, many hackers are joining the game & the report button doesn’t work too, so i wanted to ask for help.

Any more details you could provide? Such as whether it’ll be through a GUI or chat?

uhhhh GUI i guess? even if i report the player that doesn’t work too.

First, you would want to get the Username of the voted player through either a votekick command or a textbox and then store it in a value.

Next, you would want to make a yes/no button that’d fire a remote event that stores current votes and targetPlayer.

After that you wanna run a script after X amount of time to kick the player if yesVotes > noVotes.

1 Like

I hope this will work too. thanks.

I don’t like spoon feeding, so I’ll guide you to what you need instead.

    1. You need to setup remote events.
  • 2.If you want to ban you need to use a datastore.

    1. You need to send a votekick request from the client to the server, and then you need to check the amount of players that have voted yes or no, you may get the yes, no argument using the second arg in the remote event. example would be votekick:FireServer(playerbox.Text, toggle.Value), toggle would be true or false.

When getting checking on the server, you need to check if the player has voted multiple times, you need to make sure the same player can’t vote twice, etc. This can be done by storing the currentvoted players into a table. example voteTable[player.Name] = bool, after this you can collect the total answers by looping through the table and checking the results, example if the bool is yes then you check how many yes or no’s in the table, if the yes > no then you kick the player.

Check table | Roblox Creator Documentation for information about tables.

2 Likes