I have a block on a model that when it is hit by another car the other car falls apart, I use :BreakJoints() for this so if a player gets hit they die. I was trying to make it so that if the player gets hit they don't die but instead the humanoid sits and the crash sound still plays but the player doesn't die. I'm new to scripting so i cant get that advanced however my code was kinda getting confusing to understand as well. Just please tell me if you can help because the game is just a fun game to mess around in by crashing brick built cars and I want to be able to crash into my friends too and see how much fun me and my friends can have. So if you can help thanks.
function crash(hit) if hit.name ~= "Humaoid" then hit:BreakJoints() script.Parent.Crash:Play()
if hit.Name == "Humanoid" then
local humanoid = game.Players.LocalPlayer.Character:FindFirstChild("Humanoid")
if humanoid then
humanoid.Sit = true
script.Parent.Crash:Play()
wait(5)
humanoid.Sit = false
end
end
end
end script.Parent.Touched:Connect(crash)
The crash part of the script works just fine, just wanted to see if I could make it so players wouldn't die.

3 comments
You can increase the health of the humanoid to around a 100 and after the car has crashed, set it back to 100.
BreakJoints() does not care how much health does a humanoid have.
Oh lol i forgot