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

Script Doesn't Enable a PlayerGui?

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!

5 comments

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?

0

All it says is that the Gui I'm trying to edit isn't located in PlayerGui

0

Is that a LocalScript or regualr Script?

0

It's in a ModuleScript, but also doesn't work in a regular script?

0

It needs to be a localscript. You can't access the client from the server.

1 answer

✓ Accepted answer

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

Scripts are for servers not GUIs.

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