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

How do I make a GUI Giver?

Asked by 11 years ago

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

1 answer

Log in to vote
0
Answered by 11 years ago

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.

01local gui = script.Gui
02 
03function OnTouch(hit)
04    local human = hit.Parent:findFirstChild("Humanoid")
05    if human ~= nil then
06        local char = human.Parent
07        local player = game.Players:GetPlayerFromCharacter(char)
08        if player ~= nil then
09            local already = player.PlayerGui:findFirstChild(gui.Name)
10            if already == nil then -- makes sure that it doesn't two gui clones.
11                local newgui = gui:clone()
12                gui.Parent = player.PlayerGui
13            end
14        end
15    end
16end
17 
18script.Parent.Touched:connect(OnTouch)
0
Thank you soaprocks2 for helping me. iQuestionU 10 — 11y
0
np soaprocks2 75 — 11y
Ad

Answer this question