I have written a script (for a lift) where a gui is shown once the player touches the part, with teleport buttons on (so you can travel to each floor). Once you click any of the buttons, it is set to make the frame inside the GUI invisible so you can walk around. However, once its gone invisible, it does not come back if any of the blocks are touched.
This is my script inside the parts to bring up the GUI
local GUI = game.ServerStorage.LiftGUI script.Parent.Touched:Connect(function(hit) if hit.Parent and game.Players:FindFirstChild(hit.Parent.Name) then local plr = game.Players[hit.Parent.Name] if plr:FindFirstChild("PlayerGui") and not plr.PlayerGui:FindFirstChild(GUI.Name) then GUI:Clone().Parent = plr.PlayerGui end end end)
This is my teleport script inside all of the buttons in the GUI (which does the teleport and also closes the GUI)
player = game.Players.LocalPlayer button = script.Parent function onClick() script.Parent.Parent.Visible = false local LowerTorso = player.Character.LowerTorso LowerTorso.CFrame = game.Workspace.lobbytp.CFrame end button.MouseButton1Click:connect(onClick)
Any help would be great!