Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

My Timer billboard isnt working? HELP


script.Parent.Parent.Parent.Touched:connect(function(hit)
    if hit.Parent:FindFirstChild("Humanoid") then
      local plr = game.Players:GetPlayerFromCharacter(hit.Parent)
    end
end)
for i = 5, 1, -1 do
    script.Parent.Text = i

   print("Done")
end

https://gyazo.com/acc8aaca229a2730f0a1a075f3450fc5

Hi this ring is supposed to countdown from 5 whenever touched by the player but it fires 5 times and shows nothing on the billboard GUI text. Can someone help me with this

1 answer

✓ Accepted answer

enclose the for loop inside the touched and add a var that checks it

bool=false
script.Parent.Parent.Parent.Touched:Connect(function(hit)
    if hit.Parent:FindFirstChildOfClass("Humanoid") or hit.Parent.Parent:FindFirstChildOFClass("Humanoid") and not bool then bool=true
      local plr = game.Players:GetPlayerFromCharacter(hit.Parent)

for i = 5, 1, -1 do
    script.Parent.Text = i

   print("Done")
end
end
end)

1 comment

0

Will that do a countdown from 5

This discussion is preserved as it was. New answers, comments, and votes are closed.