Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

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

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

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

This discussion is preserved as it was. New answers, comments, and votes are closed.