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

Is there a way I could possible access my PlayerScripts with a global script inside Workspace?

Asked by 3 years ago

I'm trying to get a Script inside one of my models to enable a local script, but I keep getting the error: Clock.Time.SurfaceGui.Time.Script:2: attempt to index nil with 'WaitForChild'.

local Text = script.Parent
local PlayerScripts = game:GetService('Players').LocalPlayer:WaitForChild('PlayerScripts')

for i = 1,6 do
    wait(1)
    if i == 6 then
        Time = i
        Text.Text = tostring(Time).." AM"
        print("You Win")
        PlayerScripts.WinAnimation.Disabled = false
    else
        Time = i
        Text.Text = tostring(Time).." AM"
    end
end

Answer this question