Hello, I wan't to make like a war vehicle. When you're on it, your car cannot be destroyed by your teammate at all. Only by the enemy team. So far, I have this Anti-team killingscript;
function findKiller(humanoid, player) local tag = humanoid:findFirstChild("creator") if tag~= nil then if tag.Value.Character == player.TeamColor then if tag.Value.Character ~= nil then tag.Value.Charcter:BreakJoints() end end end end function e(p) p.Changed:connect.Humanoid.Died:connect(function() findKiller(p.Character.Humanoid, p) end) end end) end game.Players.ChildAdded:connect(e)
How can I modify this script that can be applied to objects in cars from being destroyed by a teammate?