RobloxScripterAI
Discord ↗
Link Copied to Clipboard
×
"create a voting system where players can vote for others buildings"
-- server script local Players = game:GetService("Players") local voteTable = {} function vote(player, buildingOwner) if not voteTable[buildingOwner] then voteTable[buildingOwner] = 0 end voteTable[buildingOwner] = voteTable[buildingOwner] + 1 end Players.PlayerAdded:Connect(function(player) player.Chatted:Connect(function(message) local command, buildingOwner = message:match("^(%S+)%s*(%S*)$") if command == "!vote" then vote(player, buildingOwner) elseif command == "!results" then for owner, votes in pairs(voteTable) do player:Kick("Player: "..owner.." Votes: "..votes) end end end) end)