How to create a votekick system?

Would look like something like this.

6 Likes

Nice, thank you

Ok, i’ve made some serious progress in my votekick system, but there’s still something i can’t decide: what should be the votation time? for now i have 30 seconds

1 Like

I’d say 1-2 mins, as people are busy with their own game, and 30 seconds in my opinion is simply too little.

WOW, that was pretty fast, anyway, going with 1 minutes and a half!

Here to help anytime! :smile:

When i finish with this system, i will modify it to be a free model, going to do that because most votekick system use the chat, and the only one that i found that doesn’t use the chat was not designed for FilteringEnabled.

So, i have run into another setback, i need a way to register who already casted a vote, due to the fact that a exploiter could mass-vote yes or no. But i have no idea how to register everything on a single variable.

Just make a table on the server, and if the person has not voted before, add their name to the table. If they have, then just end. For every value added, you can also check if enough players voted the exploiter to be kicked, and if it is enough, kick the exploiter.

There is more effective ways on diong this, take this as an example.

Interesting… can you explain a bit more about tables?

When you create a vote player script, you want to make it so there’s a variable of a number for every player. Such as this (This is a more old fashioned way of doing it);

game.Players.PlayerAdded:Connect(function(player)
        local voteValue = Instance.new("IntValue")
        voteValue.Parent = player
end)

If you have this, it will add a value inside of each player. If the player doesn’t get voted after a certain amount of seconds reset the vote count to 0. If a player leaves subtract it -1, and if a player removes their vote -1. I think you get the picture.

1 Like

Thanks for the help, going to see what i can do with that information!

No problem, also when a player votes make the value go up by 1 and if it reaches a certain amount of votes such as this kick em and it should do the trick;

local max = 5
if voteValue.Value > max then player:Kick() end

Also make it so if someone else votes the player make it so it resets the timer back to 50 seconds each time, it’s just a more simple way to do it.

I am now having the following problem: i don’t want the player who is votekicking against a player to be able to see the pop-up asking if that player should be kicked, and the player who is being voted to be kicked off the game, so i did this:

PlayerName = game.Players.LocalPlayer.name
local function OnVoteStart(SendPlayer, ply, rso)
	if PlayerName ~= SendPlayer or ply then
	print(SendPlayer .. ply .. rso .. "client")
	Description.Text = SendPlayer .. " Wants to kick " .. ply .. " For the following reason(s): " .. rso .. " Should he/she be kicked?"
MainFrame:TweenPosition(UDim2.new(0, 0,0, 0),"Out","Quint",0.3,true)
	end
end

The problem is that the check seems to be ignored. Any Ideas to fix this?

1 Like

yep they are

Remove the “or ply” and test

Results: VoteKick starter didn’t receive the prompt

When you’re doing the remote event. Send three properties: Who is voting? Yes/No. And the person being kicked

This way on the server you can keep track of who is voting. If duplicate requests are sent by the same player, you can just filter them out and have the first one take effect. You could also compare the RE with the person list on the server and use it as server sided validation.

Done all of that, anyway, the system is almost done, just finishing up some validation checks and UI functions.

1 Like

Ok, i have ran into another problem when creatin one of my checks, basically i will check for the number of children in Players to get the number of player in-game, just 1 problem:
How do i get the number of children in an instance?