generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Game Creation and Development » Scripters
Home Search
 

Previous Thread :: Next Thread 
YoursTrulyDevAccount is not online. YoursTrulyDevAccount
Joined: 01 Jan 2015
Total Posts: 73
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
oscar9999991 is not online. oscar9999991
Joined: 15 Nov 2009
Total Posts: 11373
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
BothAngles is not online. BothAngles
Joined: 01 Dec 2011
Total Posts: 9604
24 Jan 2015 08:05 PM
Possible
Possible
Possible
Report Abuse
YoursTrulyDevAccount is not online. YoursTrulyDevAccount
Joined: 01 Jan 2015
Total Posts: 73
24 Jan 2015 08:05 PM
I saw someone do it...
Report Abuse
oscar9999991 is not online. oscar9999991
Joined: 15 Nov 2009
Total Posts: 11373
24 Jan 2015 08:09 PM
As I said, to my knowledge, I didn't know you could do this
Report Abuse
Paramedic4 is not online. Paramedic4
Joined: 23 Jan 2011
Total Posts: 5934
24 Jan 2015 08:11 PM
This is all possible, use the Hit() event for dealing with explosions.
Report Abuse
Seranok is not online. 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
YoursTrulyDevAccount is not online. YoursTrulyDevAccount
Joined: 01 Jan 2015
Total Posts: 73
24 Jan 2015 09:06 PM
thanks
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripters
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image