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 » Scripting Helpers
Home Search
 

Re: how would you make it so a player blows up if brick touched

Previous Thread :: Next Thread 
ned995 is not online. ned995
Joined: 12 Jun 2009
Total Posts: 4637
24 Sep 2014 07:05 PM
ive got

function onTouch(Part)
local Player = game.Players:GetPlayerFromCharacter(Part.Parent)
if Player ~= nil then
if Player.TeamColor == BrickColor.new("Bright yellow") then
local exp = Instance.new("Explosion")
exp.BlastRadius = 500
exp.BlastPressure = 500
exp.Parent = game.Workspace.Player
exp.Position = game.Workspace.Player.Position

end
end
end
door.Touched:connect(onTouch)

idk what to do for position and parent though
Report Abuse
Superburke1 is not online. Superburke1
Joined: 29 Mar 2009
Total Posts: 2704
24 Sep 2014 07:18 PM
function onTouch(part)
local human = part.Parent:FindFirstChild("Humanoid")
if not human then return end
local player = game.Players:GetPlayerFromCharacter(part.Parent)
if not player then return end

if player.TeamColor == BrickColor.new("Bright yellow") then
local expl = Instance.new("Explosion")
expl.BlastRadius = 500
expl.BlastPressure = 500
expl.Parent = human.Parent.Torso
expl.Position = human.Parent.Torso.Position
end
end

script.Parent.Touched:connect(onTouch)
Report Abuse
ned995 is not online. ned995
Joined: 12 Jun 2009
Total Posts: 4637
24 Sep 2014 07:25 PM
thanks friend
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripting Helpers
   
 
   
  • 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