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

How do I make a GUI Giver?

How can I make a GUI appear once you step on a button? It's for one of my morphs.

1 answer

✓ Accepted answer

1.step on brick 2.see if it's a character 3.find character 4.get player from character 5.check if player already has gui 6.if no then give gui.

local gui = script.Gui

function OnTouch(hit)
	local human = hit.Parent:findFirstChild("Humanoid")
	if human ~= nil then
		local char = human.Parent
		local player = game.Players:GetPlayerFromCharacter(char)
		if player ~= nil then
			local already = player.PlayerGui:findFirstChild(gui.Name) 
			if already == nil then -- makes sure that it doesn't two gui clones.
				local newgui = gui:clone()
				gui.Parent = player.PlayerGui
			end
		end
	end
end

script.Parent.Touched:connect(OnTouch)

2 comments

0

Thank you soaprocks2 for helping me.

0

np

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