|
| 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 |
|
|
| |
|
| |
|
|
| 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 |
|
|
|
| 02 Feb 2012 01:49 PM |
| You're not making any sense there. |
|
|
| Report Abuse |
|
|
|
| 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 |
|
|
|
| 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 |
|
|
| |
|
|
| 02 Feb 2012 02:12 PM |
| Don't come here if you can't script. |
|
|
| Report Abuse |
|
|
| |
|