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

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

Asked by 10 years ago

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

Log in to vote
0
Answered by 10 years ago

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!"
0
Nope, doesn't work. The error is Workspace.Meltdown Detector:3: attempt to index global 'plr' (a nil value) WelpNathan 307 — 10y
0
Are you using a LocalScript? If not, use a LocalScript. LocalPlayer only works in a LocalScript. Spongocardo 1991 — 10y
0
Still not working? WelpNathan 307 — 10y
0
Edited answer. Spongocardo 1991 — 10y
0
Ah, I see. Thank you! :D WelpNathan 307 — 10y
Ad
Log in to vote
0
Answered by 10 years ago

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!"

0
Diddn't work. :( WelpNathan 307 — 10y
0
Most likely because you're not adding a changed event YOSkater 0 — 10y

Answer this question