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

Script Doesn't Enable a PlayerGui?

Asked by 7 years ago

In a function in a ModuleScript, the script should enable a Gui located in the player's PlayerGui. This works fine during a play test, but it doesn't work on a server test. What am I doing wrong?

function BattleScript.EnableGui(player)
    player.PlayerGui.BattleGui.Enabled = true
end

Yes, the player in the function is the player that is needed.

Thanks!

0
Can you press F9 in Online Mode to bring up the Dev console and see if there are any errors in the Client Log or Server Log? Eqicness 255 — 7y
0
All it says is that the Gui I'm trying to edit isn't located in PlayerGui dylan5225 38 — 7y
0
Is that a LocalScript or regualr Script? PolyyDev 214 — 7y
0
It's in a ModuleScript, but also doesn't work in a regular script? dylan5225 38 — 7y
0
It needs to be a localscript. You can't access the client from the server. PolyyDev 214 — 7y

1 answer

Log in to vote
0
Answered by
nap516 87
7 years ago

Try using a local script if a script is trying to access the client.

Scripts are for servers not GUIs.

Ad

Answer this question