Here's The Script:
script.Parent.TouchPart.Touched:Connect(function(hit) if hit.Parent:FindFirstChild("Humanoid") then game.GUIS.GamepassShop.ShopFrame.Visible = true game.Workspace.Map.Parts.MainBase.Touched:Connect(function(hit) if hit.Parent:FindFirstChild("Humanoid") then game.GUIS.GamepassShop.ShopFrame.Visible = false game.Workspace.Map.Parts.SideWalk2.Touched:Connect(function(hit) if hit.Parent:FindFirstChild("Humanoid") then game.GUIS.GamepassShop.ShopFrame.Visible = false end end) end end) end end)
There is no error message I don't understand what is wrong. I am a beginner scripter.
Try printing something in between lines and then checking at what line the script stops running. If the script runs through all the lines. Then it could be because your using .Touched event for opening a GUI. I would recommend using/learning Region3 because .Touched runs every time your leg / bodyPart touches the Part causing it to open and close really fast - Region3 will keep waiting until a player enters the area and will open it once
You used the wrong identification for your GUIs. Correct code should look something like this:
script.Parent.Touched:Connect(function(hit) if hit.Parent:FindFirstChildOfClass("Humanoid") then if game.Players:GetPlayerFromCharacter(hit.Parent) then local p = game.Players:GetPlayerFromCharacter(hit.Parent) p.PlayerGui.GamepassShop.ShopFrame.Visible = true end end end) game.Workspace.Map.Parts.SideWalk2.Touched:Connect(function(hit) if hit.Parent:FindFirstChildOfClass("Humanoid") then if game.Players:GetPlayerFromCharacter(hit.Parent) then local p = game.Players:GetPlayerFromCharacter(hit.Parent) p.PlayerGui.GamepassShop.ShopFrame.Visible = false end end end)