I have a teleport pad and a GUI pops up once you touch it, but I can't figure out how to remove it. Here is the script I made:
function onTouch(hit)
local ptt = game.Players:playerFromCharacter(hit.Parent) if ptt == nil then return end local wfp = script.Parent:findFirstChild("GUICRAP"):clone() if wfp == nil then return end wfp.Parent = ptt.PlayerGui
end
script.Parent.Touched:connect(onTouch)
I can't figure out how to get rid of it though.
function onTouch(hit) local ptt = game.Players:playerFromCharacter(hit.Parent) if ptt == nil then return end local wfp = script.Parent:findFirstChild("GUICRAP"):clone() if wfp == nil then return end wfp.Parent = ptt.PlayerGui end script.Parent.Touched:connect(onTouch)
That's your touch script, just create a close button:
function onClick(mouse)--DO NOT CHANGE if script.Parent.Parent.GUINAME.Visible == true then script.Parent.Parent.GUINAME.Visible == false end end script.Parent.MouseButton1Click:connect(onClick)--DO NOT CHANGE