Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

My Timer billboard isnt working? HELP

Asked by
Coder_1 27
4 years ago

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

Log in to vote
1
Answered by 4 years ago

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)
0
Will that do a countdown from 5 Coder_1 27 — 4y
Ad

Answer this question