Advertisement
Guest User

Untitled

a guest
Sep 21st, 2017
51
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.65 KB | None | 0 0
  1.  
  2. function onDied(hum,play)
  3.     if hum then
  4.         local tag = hum:FindFirstChild("creator")
  5.         if tag then
  6.             local killer = tag.Value
  7.             if killer.TeamColor == game.Workspace.Allies.TeamColor then --  Allies is the team spawn.
  8.             if play.TeamColor == game.Workspace.RAT.TeamColor then -- RAT is the team spawn.
  9.                 killer.TeamColor = game.Workspace.Raiders.TeamColor
  10.                 killer.Character:BreakJoints()
  11.             end
  12.         end
  13.     end
  14. end end
  15.  
  16. function Added(player)
  17.     player.CharacterAdded:connect(function(c)spawn(c,player)end)
  18. end
  19.  
  20. function spawn(ch,pl)
  21.     ch.Humanoid.Died:connect(function()onDied(ch.Humanoid,pl)end)
  22. end
  23.  
  24. game.Players.ChildAdded:connect(Added)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement