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 10 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 10 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.

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)
0
Thank you soaprocks2 for helping me. iQuestionU 10 — 10y
0
np soaprocks2 75 — 10y
Ad

Answer this question