Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Can someone help me with a GUI script? [SOLVED]

Asked by 10 years ago

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.

1 answer

Log in to vote
0
Answered by 10 years ago
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
Ad

Answer this question