RobloxScripterAI
Discord ↗
Link Copied to Clipboard
×
"create a votekick script"
-- server script local Players = game:GetService("Players") local ReplicatedStorage = game:GetService("ReplicatedStorage") local VoteKick = ReplicatedStorage.VoteKick local function onVoteKick(player, targetPlayer) local votes = 0 local playersVoted = {} for _, player in pairs(Players:GetPlayers()) do if player ~= targetPlayer then local vote = player:WaitForChild("VoteKick") vote.OnClientEvent:Connect(function(voteType) if voteType == "Yes" then votes = votes + 1 table.insert(playersVoted, player) end end) end end while votes < #Players - 1 do wait() end if votes >= #Players - 1 then targetPlayer:Kick("Votekicked by " .. table.concat(playersVoted, ", ")) end end VoteKick.OnServerEvent:Connect(onVoteKick)