cxcharlie
|
  |
| Joined: 26 Aug 2009 |
| Total Posts: 1414 |
|
|
| 12 Oct 2013 03:31 PM |
ex is an explosion and it's supposed to hurt plrs and NPCs, but it only hurts plrs. Why is this happening? Please find: "Damage to NPC RIGHT HERE" Thanks to everyone that helps :D (everything is defined this is only part of my script)
ex.Hit:connect(function(hitPart, partDistance) print('jiy')--goes pass if hitPart.Parent:FindFirstChild('Humanoid')~=nil then print('hum dere') local humanoid=hitPart.Parent:FindFirstChild('Humanoid') if game.Players:GetPlayerFromCharacter(hitPart.Parent).ClassName=='Player' then print('is plr') local plr=game.Players:GetPlayerFromCharacter(hitPart.Parent) if plr.TeamColor~=player.TeamColor then--Damage non-team Player
local maxDamage = 300 -- maximum possible damage local distance_factor = partDistance/ex.BlastRadius
distance_factor = 1.3 - distance_factor humanoid:TakeDamage(maxDamage*distance_factor) elseif plr.TeamColor==player.TeamColor and FriendlyFire==true then- local maxDamage = 300
local distance_factor = partDistance/ex.BlastRadius
distance_factor = 1.3 - distance_factor humanoid:TakeDamage(maxDamage*distance_factor) elseif plr.TeamColor==player.TeamColor and FriendlyFire==false then end--what team? else -- Damage to NPC RIGHT HERE print('hur noc') local maxDamage = 300 -- maximum possible damage
local distance_factor = partDistance/ex.BlastRadius
distance_factor = 1.3 - distance_factor humanoid:TakeDamage(maxDamage*distance_factor)
end--is it a real plr end--is there a humanoid in it? end)--explosion hit function |
|
|
| Report Abuse |
|
|
jnickib
|
  |
| Joined: 28 May 2012 |
| Total Posts: 137 |
|
|
| 12 Oct 2013 03:32 PM |
You need to make your question more clear.
~It's me, 08C, on an alt for 1 day! |
|
|
| Report Abuse |
|
|
cxcharlie
|
  |
| Joined: 26 Aug 2009 |
| Total Posts: 1414 |
|
|
| 12 Oct 2013 03:39 PM |
Ex is an explosion that's supposed to hurt players and NPCs. (non-Player Characters) It only hurts players. why? happy?
|
|
|
| Report Abuse |
|
|