Im trying to make a hide and seek game and i cant get the gui via player gui (sorry if i dont fully understand player gui im new) the code is
local player = game.Players.LocalPlayer local allplyrs = game.Players:GetPlayers() -- local seeker = allplyrs[math.random(1, #allplyrs)] local seeker = table.remove(allplyrs, math.random(1, #allplyrs)) local sc = seeker.PlayerGui:WaitForChild("ScreenGui") local tl = sc:WaitForChild("TextLable", 30) tl.Text = "You are: Seeker"
and the error is: " 20:34:42.323 Players.cjkizzy286.PlayerGui.ScreenGui.TextLabel.Teamsetter:9: attempt to index nil with 'Text' - Client - Teamsetter:9"
you can see where the script is via error
and finally its a local script
To get a player's character from a localscript, you would have to use player.Character