Hello!
I’m trying to make a voting system, but it’s not working!
Here is my script:
local function SelectMap()
local PossibleMaps = ServerStorage.Maps:GetChildren()
local ChosenMap = PossibleMaps[math.random(1,#PossibleMaps)]
for i, Vote in pairs(ReplicatedStorage.Votes:GetChildren()) do
if Vote.Value > game.ReplicatedStorage.Votes:FindFirstChild(ChosenMap.Name).Value then
ChosenMap = game.ServerStorage:FindFirstChild(Vote.Name)
end
end
return ChosenMap
end
Here is my ServerStorage layout:
Here is the ReplicatedStorage Layout:
Here is the error:
I voted for Map1. Map 3 isn’t built yet!