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

Is there a Child Left?

Asked by 9 years ago

Is there a ChildLeft? I want to remove the gui when the play gets out of the Car

db = true
Seat = script.Parent
Seat.ChildAdded:connect(function(child)
if child then

if child.Name == "SeatWeld" and db then
db = false
script.GUI:Clone().Parent = game.Players:GetPlayerFromCharacter(child.Part1.Parent).PlayerGui
wait(3)
db = true
end
end
end)

1 answer

Log in to vote
1
Answered by 9 years ago

What do you mean? When a players sits, it adds a SeatWeld, the SeatWeld is then removed when the player jumps out of the seat, you can use the ChildRemoved function, then you just need to check the name of the child that's been removed is SeatWeld, then you can find the player and remove the GUI from his PlayerGui.

Ad

Answer this question