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

I cant get a text label via the player gui?

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

5 comments

0

also how would i get the seekers character

0

i also tried the comment (same error)

0

I think you misspelled "TextLabel"

0

oh

0

oof

1 answer

✓ Accepted answer

To get a player's character from a localscript, you would have to use player.Character

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