I was trying to program walls that would close a shop gui if the player went through it. This is so I could prevent players from buying items for anywhere, while working on it for a while my shop guis suddenly stay open for no reason and no errors. I have no idea why either because I even undid some of the stuff I did and it stayed open. This was done in Team Create if that will answer anything.
local WeaponShopModel = workspace.Lobby["Weapon Shop"] local WeaponShop = game.StarterGui.WeaponShop local player = game.Players.LocalPlayer WeaponShop.Frame.Visible = false local function OpenWeaponShop() WeaponShop.Frame.Visible = true end local function CloseWeaponShop() WeaponShop.Frame.Visible = false end player.Character:WaitForChild("Humanoid") WeaponShopModel.ShopExit1.Touched:Connect(function(hit) if hit.Parent:FindFirstChild("Humanoid") and WeaponShop.Frame.Visible == true then CloseWeaponShop() end end) WeaponShopModel.ShopExit2.Touched:Connect(function(hit) if hit.Parent:FindFirstChild("Humanoid") and WeaponShop.Frame.Visible == true then CloseWeaponShop() end end) WeaponShopModel.Crypto.Torso.ProximityPrompt.Triggered:Connect(OpenWeaponShop) WeaponShop.Frame.Exit.MouseButton1Click:Connect(CloseWeaponShop)
I figured it out, it's because I'm editing the StarterGUI and not the player's gui. I fixed it by just changing the weaponshop variable to script.parent.WeaponShop instead of game.StarterGui.WeaponShop.