|
| 04 Apr 2014 11:44 PM |
| I am a new scripter and was wondering how to make the damage of an Explosion random. Thank you |
|
|
| Report Abuse |
|
|
| |
|
|
| 04 Apr 2014 11:49 PM |
Here is my script by the way.
while true do wait(2) e = Instance.new("Explosion", Workspace) e.ExplosionType = "Craters" e.Position = Vector3.new(0 , 10, 0) wait(1) e = Instance.new("Explosion", Workspace) e.ExplosionType = "Craters" e.Position = Vector3.new(10, 5, 10) wait(1) end
|
|
|
| Report Abuse |
|
|
|
| 04 Apr 2014 11:51 PM |
| Where would i put that in my script? |
|
|
| Report Abuse |
|
|
|
| 05 Apr 2014 12:06 AM |
range = 5 --Change to how far away one needs to be
while true do wait(2) e = Instance.new("Explosion", Workspace) e.ExplosionType = "Craters" e.Position = Vector3.new(0 , 10, 0) for _,v in pairs(Workspace:GetChildren()) do if v:findFirstChild("Humanoid") and (v.Torso.Position - e.Position).magnitude >= range then local hum = v:findFirstChild("Humanoid") hum:TakeDamage(math.random(1,20)) --Change here end end wait(1) ex = Instance.new("Explosion", Workspace) ex.ExplosionType = "Craters" ex.Position = Vector3.new(10, 5, 10) for _,o in pairs(Workspace:GetChildren()) do if v:findFirstChild("Humanoid") and (o.Torso.Position - ex.Position).magnitude >= range then local hum = v:findFirstChild("Humanoid") hum:TakeDamage(math.random(1,20)) --Change here end end wait(1) end |
|
|
| Report Abuse |
|
|
|
| 05 Apr 2014 12:08 AM |
| Why do you guys immediately help them but not me? |
|
|
| Report Abuse |
|
|
|
| 05 Apr 2014 12:09 AM |
| Their questions might be a bit easier |
|
|
| Report Abuse |
|
|
|
| 05 Apr 2014 12:09 AM |
| bcus I can choose who i want to help |
|
|
| Report Abuse |
|
|
| |
|
|
| 05 Apr 2014 12:16 AM |
The output says on line 9 attempt to compare nil with number
|
|
|
| Report Abuse |
|
|
| |
|