razor2425
|
  |
| Joined: 06 Apr 2012 |
| Total Posts: 1383 |
|
|
| 23 Jul 2015 01:21 PM |
sorry im a noob at scripting
The team changer script
----------------------------- tm = script.Parent
function onTouched(hit) local h = hit.Parent:FindFirstChild("Humanoid") if h ~= nil then local n = hit.Parent local p = game.Players:FindFirstChild(""..n.Name.."") if p ~= nil then p.TeamColor = tm.BrickColor end end end
script.Parent.Touched:connect(onTouched) ------------------------------------------
After it teams you, the kill script
------------------------------------------- function KillPlayer(part) h = part.Parent:findFirstChild("Humanoid") if h ~= nil then h.Health = 0 end end
script.Parent.Touched:connect(KillPlayer) ---------------------------------------- |
|
|
| Report Abuse |
|
|
|
| 23 Jul 2015 01:24 PM |
function onTouched(hit) local h = hit.Parent:FindFirstChild("Humanoid") if h ~= nil then h.Health = 0 local n = hit.Parent local p = game.Players:FindFirstChild(""..n.Name.."") if p ~= nil then p.TeamColor = tm.BrickColor end end end
-- Should do the exact same thing with out the extra script. |
|
|
| Report Abuse |
|
|
razor2425
|
  |
| Joined: 06 Apr 2012 |
| Total Posts: 1383 |
|
| |
|
razor2425
|
  |
| Joined: 06 Apr 2012 |
| Total Posts: 1383 |
|
|
| 23 Jul 2015 01:25 PM |
| wait a sec that script dosent work |
|
|
| Report Abuse |
|
|
chimmihc
|
  |
| Joined: 01 Sep 2014 |
| Total Posts: 17143 |
|
|
| 23 Jul 2015 01:36 PM |
script.Parent.Touched:connect(function(hit) if hit.Parent then local player = game.Player:GetPlayerFromCharacter(hit.Parent) if player then player.Teamcolor = script.Parent.BrickColor hit.Parent:BreakJoints() end end end) |
|
|
| Report Abuse |
|
|