niels22
|
  |
| Joined: 23 Jan 2009 |
| Total Posts: 700 |
|
|
| 19 Feb 2012 09:02 AM |
Hello there.
So I've been messing with this damage script for hours (lame) and can't get it to work. Source: ------------------------------------------- CD = true B = script.Parent player = script.P.Value
function Touched(hit) if CD == true then if hit.Parent:findFirstChild("Humanoid") or hit.Parent.Parent:findFirstChild("Humanoid") and CD == true then if game.Players:GetPlayerFromCharacter(hit.Parent).TeamColor ~= player.TeamColor then hit.Parent.Humanoid:TakeDamage(math.random(5,10)) end end if hit.Parent:findFirstChild("H") then if player.TeamColor ~= game.Teams["Train Team"].TeamColor then hit.Parent.H.Value = hit.Parent.H.Value - math.random(5,10) print(hit.Parent.H.Value) end end B.BodyForce:Destroy() script:Remove() end CD = false end
B.Touched:connect(Touched) ------------------------------------------------- The script is placed in the bullet P is defined (value is set to my player) H is a child of the target Train Team is exicting in game.Teams
What is wrong? |
|
|
| Report Abuse |
|
|
niels22
|
  |
| Joined: 23 Jan 2009 |
| Total Posts: 700 |
|
| |
|
niels22
|
  |
| Joined: 23 Jan 2009 |
| Total Posts: 700 |
|
|
| 20 Feb 2012 08:53 AM |
| Still no help... bump!... did you hear that? |
|
|
| Report Abuse |
|
|
niels22
|
  |
| Joined: 23 Jan 2009 |
| Total Posts: 700 |
|
|
| 20 Feb 2012 11:00 AM |
| Great, I'll just completely rescript it tommorow. |
|
|
| Report Abuse |
|
|