I am trying to create a function where when the player sits; the sound is activated. Until he "jumps" off the seat, which will disable the sound. But for some reason it's not working and not displaying any errors in the Output. Is there something i'm doing wrong?
function onChildAdded(child) if child.Name == "SeatWeld" then if child.Part1.Name == "Torso" then local player = game.Players:GetPlayerFromCharacter(child.Part1.Parent) if player ~= nil then script.Parent.Engine:Play() end end end end function onChildRemoved() script.Parent.Engine:Stop() end script.Parent.ChildAdded:connect(onChildAdded) script.Parent.ChildRemoved:connect(onChildRemoved)