|
| 24 Jan 2015 07:32 PM |
I need an explosion in which:
-I can make anti-teamkill
-Configure the damage of the splash damage.
-Configure the damage of direct damage.
|
|
|
| Report Abuse |
|
|
|
| 24 Jan 2015 07:37 PM |
As far as I know,
1) Not possible
2) The best you can do is adjust the size of the explosion
3) Not possible |
|
|
| Report Abuse |
|
|
| |
|
| |
|
|
| 24 Jan 2015 08:09 PM |
| As I said, to my knowledge, I didn't know you could do this |
|
|
| Report Abuse |
|
|
|
| 24 Jan 2015 08:11 PM |
| This is all possible, use the Hit() event for dealing with explosions. |
|
|
| Report Abuse |
|
|
Seranok
|
  |
| Joined: 12 Dec 2009 |
| Total Posts: 11083 |
|
|
| 24 Jan 2015 08:17 PM |
Explosions kill humanoids by destroying their neck joint. To prevent this, set DestroyJointRadiusPercent to 0.
local explosion = Instance.new("Explosion") explosion.DestroyJointRadiusPercent = 0
Then to re-add the damage:
local maxDamage = 100
explosion.BlastRadius = 8 explosion.Hit:connect(function(part, distance) local humanoid = part.Parent:FindFirstChild("Humanoid") if humanoid then -- get the distance as a value between 0 and 1 local distanceFactor = distance / explosion.BlastRadius -- flip the amount, so that closers objects get more damage distanceFactor = 1 - distanceFactor humanoid:TakeDamage(maxDamage * distanceFactor) end end) explosion.Parent = workspace
And now just add a check so that no damage is dealt if the players are on the same team. |
|
|
| Report Abuse |
|
|
| |
|