This script was literally working yesterday. Now every time the Player jumps off the seat it freezes and crashes Roblox. I get no errors, parenting is correct. There's no reason it should be acting like this.
seat = script.Parent
function onSitUp(child, Drift, EMP, GUI)
if child.Parent == nil then
Drift.Disabled = true
EMP.Disabled = true
Drift.Parent = script
EMP.Parent = script
GUI.Parent = script
end
end
function onChildAdded(part)
local char = script.Parent.Parent.Parent.Parent
if char then
local Drift = script["Drift"]
local EMP = script["EMPscript"]
Drift.Parent = char
Drift.Disabled = false
EMP.Parent = char
EMP.Disabled = false
local GUI = script["Controls"]
local player = game.Players:GetPlayerFromCharacter(char)
GUI.Parent = player.PlayerGui
part.AncestryChanged:connect(function(child) onSitUp(child, EMP, GUI, Drift, script.Parent) end)
end
end
seat.ChildAdded:connect(onChildAdded)

5 comments
Okay. So Ancestrychange caused the freeze I guess. But ChildRemoved doesn't work.
By not work I mean it wont execute line 24 then.
Put a couple prints in, before line 24, within the ChildRemove and after it's passed
That wasnt it. I just realized what it was. Thanks for helping though. Here's a +1
Glad you found it, and cheers.