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

Cloning a GUI into a player? [UPDATE]

Asked by 8 years ago

So. I'm trying to get a GUI inside a seat to clone into the player when they sit down, and removed when they stand up.

I have done the Giving GUI.

script.Parent.ChildAdded:connect(function() 
    if (script.Parent:findFirstChild("SeatWeld")) then 
        if (game.Players:GetPlayerFromCharacter(script.Parent.SeatWeld.Part1.Parent)) then 
            player = game.Players:GetPlayerFromCharacter(script.Parent.SeatWeld.Part1.Parent) 
            --Irrelevant code here
            script.Parent.GUI:Clone().Parent = game.Players:GetPlayerFromCharacter(script.Parent.SeatWeld.Part1.Parent).PlayerGui

My questions.

How do I remove the GUI?

The only thing I can do with the removal.

script.Parent.ChildRemoved:connect(function() 

end)

Answer this question