i want to make a vote system with image on it.but when i run a code it runs like 1000+ times like this https://gyazo.com/84a6b2b998aee21b738ef60b6429e2b1 i dont know how to fix it, any help would be appreciated
heres the script
local start = tick()
while wait() do
if tick()-start >= settings.mapVoteTime then break end
local secondsleft = math.floor(settings.mapVoteTime-(tick()-start))
stats.Status.Value = secondsleft.." "..((secondsleft==1 and "second" or secondsleft==0 and "second")or "seconds").." to choose lmao"
for e,f in pairs(Game.Special.Board:GetChildren()) do
for a,b in pairs(Game.Special.VotingPads:GetChildren()) do
local playerVoting, mName
for d,c in pairs(mapVotes) do
if c.id == tonumber(f.Name:match("%d+")) then
playersVoting = #c.players
mName = c.mapName
if mName == "Basement" then
local imagelabel = Instance.new("ImageLabel",f.sGui)
imagelabel.Position = UDim2.new(0,0,0.1,0)
imagelabel.Size = UDim2.new(1,0,0.9,0)
imagelabel.Image = "rbxassetid://73737626"
imagelabel.Name = "Epic"
print("imagelabel has been added")
elseif mName == "Mall" then
local imagelabel = Instance.new("ImageLabel",f.sGui)
imagelabel.Position = UDim2.new(0,0,0.1,0)
imagelabel.Size = UDim2.new(1,0,0.9,0)
imagelabel.Image = "rbxassetid://112902314"
imagelabel.Name = "Epic"
elseif mName == "Office" then
local imagelabel = Instance.new("ImageLabel",f.sGui)
imagelabel.Position = UDim2.new(0,0,0.1,0)
imagelabel.Size = UDim2.new(1,0,0.9,0)
imagelabel.Image = "rbxassetid://435858274"
imagelabel.Name = "Epic"
elseif mName == "ChapterTwo" then
local imagelabel = Instance.new("ImageLabel",f.sGui)
imagelabel.Position = UDim2.new(0,0,0.1,0)
imagelabel.Size = UDim2.new(1,0,0.9,0)
imagelabel.Image = "rbxassetid://149369874"
imagelabel.Name = "Epic"
end
break
end
end
end
end
end

1 comment
Oh wow it works thanks dude