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
 

Re: Can someone tell me what is wrong with this script?

Previous Thread :: Next Thread 
The_Governator is not online. The_Governator
Joined: 02 Mar 2016
Total Posts: 254
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 is not online. 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 is not online. 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
killerbot29003 is online. killerbot29003
Joined: 04 Oct 2014
Total Posts: 3054
22 May 2016 02:14 PM
Use Region3


This siggy is copyrighted ©
Report Abuse
The_Governator is not online. The_Governator
Joined: 02 Mar 2016
Total Posts: 254
22 May 2016 02:22 PM
can someone implement this into my script?
Report Abuse
The_Governator is not online. The_Governator
Joined: 02 Mar 2016
Total Posts: 254
27 May 2016 02:24 PM
bump
Report Abuse
The_Governator is not online. The_Governator
Joined: 02 Mar 2016
Total Posts: 254
27 May 2016 06:57 PM
bumpppp
Report Abuse
Waterlimon is not online. Waterlimon
Joined: 25 Apr 2009
Total Posts: 18821
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
The_Governator is not online. The_Governator
Joined: 02 Mar 2016
Total Posts: 254
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
The_Governator is not online. The_Governator
Joined: 02 Mar 2016
Total Posts: 254
27 May 2016 11:17 PM
bunp


#code local RAP = "R$468" local ROBUX ="R$4,533"
Report Abuse
The_Governator is not online. The_Governator
Joined: 02 Mar 2016
Total Posts: 254
27 May 2016 11:50 PM
bumpp


#code local RAP = "R$462" local ROBUX ="R$4,533"
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