This codes opens when someone else steps on the object, please explain to me how to fix it Code:
game.Workspace.ShopPart.Touched:Connect(function(hit) if hit then script.Parent.Shop.PetInventory.Visible = true end end)
-- Script in ServerScriptService local guiname="ScreenGui" -- change local Players=game:GetService"Players" local function showgui(player,guiname) player.PlayerGui[guiname].Shop.PetInventory.Visible=true end local a;workspace.ShopPart.Touched:Connect(function(part) if a then return end;a=true local player=Players:GetPlayerFromCharacter(part.Parent) if player then pcall(showgui,player,guiname) end wait(1)a=false end)
So basically its just getting when its touched and if hit then is just soemthing to check