ok so i make a Marvel game and for Human Torch from the Fantastic 4 i wanted a "Fire Fly" it works perfectly except for the fact that when i stop flying i die. this is very disappointing cause i have tried to fix it several times and i just cant. this is the clip of script that i have that i made to the original fly i have to make the fire bellow...
001 | function Fly() |
002 |
003 | if Flying and Player and Torso and Humanoid and Humanoid.Health > 0 then |
004 |
005 | local Momentum = Vector 3. new( 0 , 0 , 0 ) |
006 | local LastMomentum = Vector 3. new( 0 , 0 , 0 ) |
007 | local LastTilt = 0 |
008 | local CurrentSpeed = Speed.MaxSpeed |
009 | local Inertia = ( 1 - (Speed.CurrentSpeed / CurrentSpeed)) |
010 | fire = Instance.new( "Fire" ) |
011 | fire.Heat = 0 |
012 | fire.Size = 10 |
013 | fire.Parent = script.Parent.Parent [ "Left Leg" ] |
014 | fire 2 = Instance.new( "Fire" ) |
015 | fire 2. Heat = 0 |
ive also tried making the fire greenish for my Dr. Strange but i dont know how to change the color!! D:
if you have time can you also tell me how to use this with particles ... cause i cant figure it out trying to use my own decals ... i just get the classic particle decal.
thank you for reading this and thank you for any help i may receive
~FinickOdre123
You die when you stop flying because of this line:
1 | script.Parent.Parent.Torso:ClearAllChildren() |
2 | -- Humanoid is inside the torso! |
3 | -- Deleting the Humanoid kills the Player! |
Here is the wiki page to the class Fire.
Two properties of fire you can modify are Color and SecondaryColor.
Here's an example in case you are unfamiliar with editing Color3's:
1 | local fire 1 = Instance.new( "Fire" , script.Parent.Torso) |
2 | fire 1. Size = 10 |
3 | fire 1. Color = Color 3. new( 0 / 255 , 102 / 255 , 0 / 255 ) |
Edit If you need to clear the children of Torso without deleting the Humanoid, you can make your own custom ClearAllChildren()
function (kind of)
ClearAllChildren()
is equivalent to something like this:
1 | for _, v in pairs (object:GetChildren()) do |
2 | v:Destroy() |
3 | end |
So, to ClearAllChildren()
except Humanoid, add a conditional:
1 | for _, v in pairs (script.Parent.Parent.Torso:GetChildren()) do |
2 | if v.ClassName ~ = "Humanoid" then |
3 | v:Destroy() |
4 | end |
5 | end |