Hi,
I'm working on a game where the user clicks on certain objects, modals appear. I have it working when, in Roblox Studio, I choose "Play" or "Play Here". However, when I choose to "Start" a "Local Server", the modals do not appear when clicking on those objects.
Here's the code I am using to make a modal appear:
function onClicked(player) player.PlayerGui.GameConsoleGui.WelcomeModal.Enabled = true end
script.Parent.ClickDetector.MouseClick:connect(onClicked)
The modals are ScreenGui objects that have "Enabled" set to false by default, and only have "Enabled" set to true by scripts.
Appreciate any help with this.
You cannot access PlayerGui elements and edit them via a Script. You must use a local script. Just clone a local script to the player and have it run the function, and then have the script remove itself.
Have the server sided script as is, but clone a local script.
Have a client script that runs the code
wait(1) player.PlayerGui.GameConsoleGui.WelcomeModal.Enabled = true wait(0.1) script:Destroy()