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

[UNANSWERED] What's wrong with my script?

Asked by
Sam4550 42
10 years ago

When the player sits in the seat, the GUI should clone as 'guiClone'. When the player jumps out, 'guiClone' should destroy itself. This just isn't happening!

Please help me!

gui = script.Parent.Controls
guiClone = nil

script.Parent.ChildAdded:connect(function(SeatWeld)
    char = SeatWeld.Part1.Parent
    player = game.Players:GetPlayerFromCharacter(char)
    guiClone = gui:Clone()
    guiClone.Parent = player.PlayerGui
end)

script.Parent.ChildRemoved:connect(function(removeWeld)
    if guiClone then
        guiClone:Destroy()
    end
end)
0
Any errors? ultimate055 150 — 10y
0
Nothing. I tried using print("text") between lines 4-5 and when I sat in the seat, it didn't show up in the output. Nothing in the output, no errors. The GUI's descendants are all visible. Sam4550 42 — 10y

Answer this question