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: why wont this work?

Previous Thread :: Next Thread 
TheWhiteAngle is not online. TheWhiteAngle
Joined: 31 Dec 2011
Total Posts: 435
02 Feb 2012 01:16 PM
it wont remove the fire when i dont hit the sun

while true do --loop
wait() --wait
local ray = Ray.new(script.Parent.Position, game.Lighting:GetSunDirection()*999) --make a new ray from my head to the sun direction
local hit = game.Workspace:FindPartOnRay(ray) --find the ray part
if hit then --if the ray hit the sun then
if not script.Parent.Parent.Torso:findFirstChild("Fire") then --if fire is not in the torso then
Instance.new("Fire", script.Parent.Parent.Torso) --make fire on my body
elseif not hit then --but if the ray dont hit the sun then
if script.Parent.Parent.Torso:findFirstChild("Fire") then --if fire is in the torso then
script.Parent.Parent.Torso:findFirstChild("Fire"):Remove() --remove the fire from the torso
end
end
end
end
--finished
Report Abuse
TheWhiteAngle is not online. TheWhiteAngle
Joined: 31 Dec 2011
Total Posts: 435
02 Feb 2012 01:46 PM
PLEASE HELP ME! UGGH
Report Abuse
MasterOfDeathOnes is not online. MasterOfDeathOnes
Joined: 21 Mar 2009
Total Posts: 6975
02 Feb 2012 01:47 PM
The sun can't be hit.
Report Abuse
TheWhiteAngle is not online. TheWhiteAngle
Joined: 31 Dec 2011
Total Posts: 435
02 Feb 2012 01:48 PM
then how im going to do this...
im trying to do that if i go out side i get fire, and if im inside i dont get fire.
Report Abuse
MasterOfDeathOnes is not online. MasterOfDeathOnes
Joined: 21 Mar 2009
Total Posts: 6975
02 Feb 2012 01:49 PM
You're not making any sense there.
Report Abuse
TheWhiteAngle is not online. TheWhiteAngle
Joined: 31 Dec 2011
Total Posts: 435
02 Feb 2012 01:51 PM
Last time i tried so when the closes brick there is next to me its disstance no less then 5 then i wont get fire, it is to complicated to make, not im trying that if the ray from the sun not hitting me then i wont get fire. do you get me?
Report Abuse
MasterOfDeathOnes is not online. MasterOfDeathOnes
Joined: 21 Mar 2009
Total Posts: 6975
02 Feb 2012 01:56 PM
function get(root)
local done = false
if (root.Position-torso.Position).magnitude < 5 then
done = false
end
local c = root:GetChildren()
for i = 1, #c do
done = (done or get(c[i]))
end
return done
end

get(workspace)
Report Abuse
TheWhiteAngle is not online. TheWhiteAngle
Joined: 31 Dec 2011
Total Posts: 435
02 Feb 2012 02:11 PM
i dont get wht you did
Report Abuse
MasterOfDeathOnes is not online. MasterOfDeathOnes
Joined: 21 Mar 2009
Total Posts: 6975
02 Feb 2012 02:12 PM
Don't come here if you can't script.
Report Abuse
TheWhiteAngle is not online. TheWhiteAngle
Joined: 31 Dec 2011
Total Posts: 435
02 Feb 2012 02:22 PM
EXSUSE ME?
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