|
| 20 Aug 2012 09:09 AM |
ExpRadius = 8 MinDamage = 0 MaxDamage = 120
Detonated = false Multiplier = (MaxDamage-MinDamage)/ExpRadius
ball = script.Parent
function onTouched(hit) if Detonated == true then return end if hit.Name == "Border" then return end if hit.Transparency >= 0.975 then return end Detonated = true local e = Instance.new("Explosion") e.Parent = game.Workspace e.Position = ball.Position e.ExplosionType = 2 e.BlastPressure = 5 e.BlastRadius = ExpRadius e.Hit:connect(function(Hit, Distance) local humanoid = Hit.Parent:FindFirstChild("Humanoid") local Bag = ball:findFirstChild("creator") if humanoid then tagHumanoid(humanoid) local Flip = ExpRadius-Distance local Receive = (Flip*Multiplier)+MinDamage humanoid:TakeDamage(Receive) print(Bag.Value.Name.." Detonated "..humanoid.Name..", causing "..Receive.." Damage. The explosion happened "..Distance.." studs away from the victim yeilding "..Flip.." Power.") end end) e:Destroy() end
function tagHumanoid(humanoid) local Bag = ball:findFirstChild("creator") if Bag ~= nil then local NTag = Bag:clone() NTag.Parent = humanoid game:GetService("Debris"):AddItem(NTag, 2) end end
game:GetService("Debris"):AddItem(ball, 10) ball.Touched:connect(onTouched)
e.Hit:connect(function(Hit, Distance) is never triggered |
|
|
| Report Abuse |
|
|
| |
|
| |
|
|
| 20 Aug 2012 09:40 AM |
@Destroshun Please troll + noob, Get out. |
|
|
| Report Abuse |
|
|
|
| 20 Aug 2012 09:41 AM |
I'm not the idiot that can't trigger an explosion.
† KMXD 2.0 † |
|
|
| Report Abuse |
|
|
|
| 20 Aug 2012 09:43 AM |
Hah, you don't even understand what Explosion.Hit is. I can create the explosion, but I can't utilize the event which is called when a part is in the Radius of an explosion. |
|
|
| Report Abuse |
|
|
|
| 20 Aug 2012 09:46 AM |
I am not sure how .Hit works, since I've never used it before, But you should also try if it works with magnitude. Not that hard to do. |
|
|
| Report Abuse |
|
|
|
| 20 Aug 2012 09:46 AM |
| You need to create the event BEFORE you set the parent of the explosion. |
|
|
| Report Abuse |
|
|
|
| 20 Aug 2012 09:47 AM |
Noob got owned by crazyman32 :P
† KMXD 2.0 † |
|
|
| Report Abuse |
|
|
| |
|
|
| 20 Aug 2012 09:49 AM |
@TheNoob2Above
How is being helped called "Owned"
Get out, Troll. |
|
|
| Report Abuse |
|
|
|
| 20 Aug 2012 09:49 AM |
Also the Hit event is a little buggy, so be precautionary with it.
Sometimes I've had instances where it says EVERY object was hit by the explosion, even when they were not. |
|
|
| Report Abuse |
|
|
|
| 20 Aug 2012 09:50 AM |
Shut up idiot.
† KMXD 2.0 † |
|
|
| Report Abuse |
|
|
|
| 20 Aug 2012 09:50 AM |
Not you crazy.
† KMXD 2.0 † |
|
|
| Report Abuse |
|
|
|
| 20 Aug 2012 09:52 AM |
| Thanks for the heads up. If I find that it is causing that glitch too, I'll add a restriction to check its magnitude. |
|
|
| Report Abuse |
|
|