|
| 22 May 2016 01:55 PM |
I am quite a beginner with scripting, but im learning. Anyway, there is this youtube video by shedletsky called burninate, to find it, just search burninate roblox on utube, im trying to replicate the fire shield thing, this is as far as i got
workspace:WaitForChild'Player1' torso = workspace.Player1.Torso --change zis radius = 30 --change zis too
function burn(a) Instance.new('Fire',a) end
game:GetService'RunService'.Stepped:connect(function() local a = workspace:GetChildren()
for i=1,#a,1 do local b = a[i] if b:FindFirstChild'Torso' ~= nil then if b ~= torso.Parent and (b.Torso.Position - torso.Position).magnitude < radius then if b.ClassName == 'Humanoid' then if b.Health > 0 then Instance.new('Explosion',workspace).Position = a.Torso for i=1,#a,1 do local c = a[i] if c.ClassName == 'Part' then burn(c) end end end end end end
end end)
what's wrong with it? |
|
|
| Report Abuse |
|
|
TimeTicks
|
  |
| Joined: 27 Apr 2011 |
| Total Posts: 27115 |
|
|
| 22 May 2016 01:56 PM |
if this is a local script then
local player = game.Players.LocalPlayer |
|
|
| Report Abuse |
|
|
pketny
|
  |
| Joined: 27 Dec 2010 |
| Total Posts: 1162 |
|
|
| 22 May 2016 01:58 PM |
Note that you are trying to loop through to workspace every rendered step:
game:GetService'RunService'.Stepped:connect(function() local a = workspace:GetChildren()
for i=1,#a,1 do |
|
|
| Report Abuse |
|
|
|
| 22 May 2016 02:14 PM |
Use Region3
This siggy is copyrighted © |
|
|
| Report Abuse |
|
|
|
| 22 May 2016 02:22 PM |
| can someone implement this into my script? |
|
|
| Report Abuse |
|
|
| |
|
| |
|
|
| 27 May 2016 08:38 PM |
local torso = workspace:WaitForChild('Player1').Torso --Source of explosion local radius = 30 --Radius of explosion
function burn(a) Instance.new('Fire',a) end
game:GetService('RunService').Stepped:connect(function() for _,v in pairs(workspace:GetChildren()) do --proper syntax to iterate over table if v:FindFirstChild('Torso') then --dont need to ~=nil because nil is interpreted as 'false' automatically (and an existing instance as 'true') if v ~= torso.Parent and (v.Torso.Position - torso.Position).magnitude < radius then if v:FindFirstChild("Humanoid") then --This was wrong (v would be a character, not a humanoid) if v.Humanoid.Health > 0 then --same issue as above Instance.new('Explosion',workspace).Position = v.Torso -- "a.Torso" was wrong because a was a table of all things in workspace, not a character for _,bodyPart in pairs(v:GetChildren()) do --we want children of the character, not all things in workspace if bodyPart:IsA("BasePart") then burn(bodyPart) end --Use 'IsA("BasePart")' so it works for all types of parts, not just the box shaped regular ones (so also seats, wedges, unions...) end end end end end
end end)
This might work, also tried to clean it up a bit.
Read it so you understand why the original one didnt work. |
|
|
| Report Abuse |
|
|
|
| 27 May 2016 11:15 PM |
Thanks for the support Waterlimon, When I spawn a Humanoid to test this the explosion spawns away from the character, also do I put this in a hopperbin, starterpack or startergui?
#code local RAP = "R$468" local ROBUX ="R$4,533" |
|
|
| Report Abuse |
|
|
|
| 27 May 2016 11:17 PM |
bunp
#code local RAP = "R$468" local ROBUX ="R$4,533" |
|
|
| Report Abuse |
|
|
|
| 27 May 2016 11:50 PM |
bumpp
#code local RAP = "R$462" local ROBUX ="R$4,533" |
|
|
| Report Abuse |
|
|