So I'm trying to make a bank robbery simulation, but I'm somehow having trouble with popping up the gui when you touch a brick. I'll make it close later in time but I just want it to open right now. Here is the code
workspace.RobBank.Touched:connect(function() game.StarterGui.ScreenGui.MainRobbery.Visible = true end)
There are no errors, I don't know what's wrong.
This might be a simple fix, but I can't catch it. Can one of you help?
Thanks.
What I did was I put a script in the RobBank part, then wrote this in the script, when I tried it in studio myself it worked. Hopefully this helps.
script.Parent.Touched:connect(function() game.Players.LocalPlayer.PlayerGui.ScreenGui.MainRobbery.Visible = true end)
Modifying StarterGui doesn't change anything. You have to modify the within the player object (the one in game.Players)
You can do this to solve your problem:
[Must be in a LocalScript]
local player = game.Players.LocalPlayer script.Parent.Touched:connect(function() player.PlayerGui.ScreenGui.MainRobbery.Visible = true end)