script.Parent.Touched:Connect(function(HIT)
local player = game.Players:GetPlayerFromCharacter(HIT.Parent)
if player == game.Players.LocalPlayer then
player.PlayerGui.ScreenGui.Shop.Visible = true
end
end)
script.Parent.TouchEnded:Connect(function(HIT)
local player = game.Players:GetPlayerFromCharacter(HIT.Parent)
if player == game.Players.LocalPlayer then
player.PlayerGui.ScreenGui.Shop.Visible = false
end
end)
This is in a local script in a brick.
What is wrong here?

1 comment
I have had this problem before too. I just made it a regular script in StarterGui with a player variable and a click detector to make it open. Example: local plr = script.Parent.Parent local click = game.Workspace.ATM.Open.ClickDetector
click.MouseClick:connect(function() plr.PlayerGui.ATM.Enabled = true
end)