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

Can someone help troubleshoot? FIXED

Asked by 10 years ago

So here is the code

print("enter")
function countdown(length)
    local h=script.Parent
    for i = length,1,-1 do
        h.Text = tostring(i)
        wait(1)
    end

end

print("entrrhdher")
game.Players.PlayerAdded:connect(function(plr) -- It doesnt print anything below, no stack end

    print("enter2")--Doesnt print this
    if plr.Name=="Obscuriti" or plr.Name=="MathisGuidonsio" or plr.Name=="Tempestatem" or plr.Name=="ImperatorVince" then
        print("Hello")
    plr.Chatted:connect(function(msg)
    print("Timer")
        if msg:sub(1,7) == "/timer " then
    print("Timer2")
    for k, p in pairs(game.Players:GetPlayers()) do
    p.PlayerGui.TimerGui.Frame.Visible=true
    end
            local time = tonumber(msg:sub(8)) 
            countdown(time)
    for k, p in pairs(game.Players:GetPlayers()) do
    p.PlayerGui.TimerGui.Frame.Visible=false
    end     


        end

    end)
    end

end)

FIXED

I changed playeradded to a while loop and for k,plr in pairs

0
How are you testing? Normally, scripts cannot connect quickly enough to PlayerAdded to catch Test Solo players joining BlueTaslem 18071 — 10y
0
I am doing it in game Tempestatem 884 — 10y
1
I fixed it. Tempestatem 884 — 10y

Answer this question