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

How do I enable something from a PlayersGui? [ANSWERED]

This is a question I have always wanted to know. I tried to make a script but it does not work.

I know it is a bit of a request, but I urgently need to know!

I know you put stuff in the StarterGui. Then the StarterGui transfers to the PlayerGui.

This is what I came up with.. I really don't know..

plr = game.Players.LocalPlayer

plr.PlayerGui.SurfaceGui.TextLabel.Text = "test!

There is also no error.

2 answers

✓ Accepted answer

You're probably looking for the Visible property.

Replace Enabled with Visible and it should become visible.

local plr = game.Players.LocalPlayer
local surface = plr.PlayerGui:WaitForChild("SurfaceGui")

surface:WaitForChild("TextLabel").Text = "Test!"

5 comments

0

Nope, doesn't work. The error is Workspace.Meltdown Detector:3: attempt to index global 'plr' (a nil value)

0

Are you using a LocalScript? If not, use a LocalScript. LocalPlayer only works in a LocalScript.

0

Still not working?

0

Edited answer.

0

Ah, I see. Thank you! :D

plr = game.Players.LocalPlayer

plr:WaitForChild("PlayerGui").SurfaceGui.TextLabel.Text = "Hello World!"

If that doesn't work you might want to add a frame into the SurfaceGui

ONLY IF IT DIDN'T WORK* plr = game.Players.LocalPlayer

plr:WaitForChild("PlayerGui").SurfaceGui.Frame.TextLabel.Text = "Hello World!"

2 comments

0

Diddn't work. :(

0

Most likely because you're not adding a changed event

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