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

How to change a value inside a GUI?

Asked by 6 years ago

This works in the studio but when I try it in game, it doesn't work.

local pl = game.Players.LocalPlayer:FindFirstChild("PlayerGui")
pl.IntroGui.Value.Value = 1

I tried using LocalScript, it didn't work at all.

I think game.Players.LocalPlayer is the mistake but I can't figure it out.

0
A LocalScript is necessary, since the server can't access the clients' PlayerGuis' descedants - only when the server parented it. You should also know that everything wouldn't load in immediately. Show the hierarchy of the gui Rare_tendo 3000 — 6y
0
I know that, that's why I'm checking with you. Should I use 'WaitForChild("PlayerGui")'? carlito1236 24 — 6y
0
Have you tried using this as a local script, inside the GUI? Lugical 425 — 6y
0
I need the script to be in workspace. carlito1236 24 — 6y
View all comments (2 more)
0
where is the number value located? FirezoneGamez 155 — 6y
0
The value is located in the Gui and the script in workspace. carlito1236 24 — 6y

1 answer

Log in to vote
1
Answered by 6 years ago

Using game.Players.LocalPlayer, you will need a LocalScript.

According to one of your comments, you need your script to be in workspace. In that case, I recommend that you use RemoteEvents for Client-Server communication. Your serverscript will send a request to the Client which will execute that script.

Learn more about remote events HERE

0
Thank you for your help, but I decided to put the NumberValue in Workspace. carlito1236 24 — 6y
Ad

Answer this question