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

How do I make an Anti-Team destroying vehicle? Help?

Asked by 6 years ago

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?

Answer this question