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
We use cookies to offer you a better experience. By using Roblox.com, you are agreeing to our Privacy and Cookie Policy.
   
ROBLOX Forum » Game Creation and Development » Scripters
Home Search
 

Re: Non-team killing explosion script not working?

Previous Thread :: Next Thread 
CoolJohnnyboy is not online. CoolJohnnyboy
Joined: 09 Mar 2010
Total Posts: 17699
19 Jul 2016 11:15 AM
This script is supposed to create an explosion, and kill any members of enemy teams, without causing an actual explosion (that would destroy/kill anything, regardless of team) occurring.

The script doesn't do anything, and I don't know why. Output didn't give me anything.

Can someone please help me?

Here's the script:

local activated = false
local mash = math.random(20,30)

function Hurt(hit)
if hit.Parent then
if hit.Parent:findFirstChild("Humanoid") then
local Person = script.Parent:findFirstChild("creator")
local victim = game.Players:findFirstChild(hit.Parent.Name)
if victim ~= Person.Value and victim.TeamColor ~= Person.Value.TeamColor then
local New = 300
local ct=script.Parent:FindFirstChild("creator")
ct:clone().Parent = hit.Parent.Humanoid
wait(0.01)
hit.Parent.Humanoid:TakeDamage(New)
end
end
end
end

function onTouch(hit)
if not activated then
script.Parent.Transparency = 1
script.Parent.Anchored = true
activated = true
local sound = Instance.new("Sound")
sound.SoundId = "http://www.roblox.com/asset/?id=16976189"
sound.Pitch = .9
sound.Volume = 1
sound.Parent = script.Parent
sound:Play()
local e = Instance.new("Explosion")
e.BlastPressure = 0
e.BlastRadius = 60
e.Parent = game.Workspace
e.Hit:connect(Hurt)
e.Position = script.Parent.Position
script.Parent:remove()
end
end

script.Parent.Touched:connect(onTouch)

Report Abuse
lululukas is not online. lululukas
Joined: 23 Aug 2010
Total Posts: 1043
19 Jul 2016 11:26 AM
" if victim ~= Person.Value and victim.TeamColor ~= Person.Value.TeamColor then"

what?


Report Abuse
CoolJohnnyboy is not online. CoolJohnnyboy
Joined: 09 Mar 2010
Total Posts: 17699
19 Jul 2016 11:37 AM
@Lululukas

A very unnecessary part of the script, I know, and I should probably omit it.
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