Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

problems scripting a fly?

Asked by 9 years ago

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...

001function Fly()
002 
003    if Flying and Player and Torso and Humanoid and Humanoid.Health > 0 then
004 
005        local Momentum = Vector3.new(0, 0, 0)
006        local LastMomentum = Vector3.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        fire2=Instance.new("Fire")
015        fire2.Heat=0
View all 110 lines...

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

0
Did you write this all from scratch? Validark 1580 — 9y

1 answer

Log in to vote
0
Answered by
Validark 1580 Snack Break Moderation Voter
9 years ago

You die when you stop flying because of this line:

1script.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:

1local fire1 = Instance.new("Fire", script.Parent.Torso)
2fire1.Size = 10
3fire1.Color = Color3.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:

1for _, v in pairs(object:GetChildren()) do
2    v:Destroy()
3end

So, to ClearAllChildren() except Humanoid, add a conditional:

1for _, v in pairs(script.Parent.Parent.Torso:GetChildren()) do
2    if v.ClassName ~= "Humanoid" then
3        v:Destroy()
4    end
5end
0
ok so i tried this fire coloration and it made the fire green but i couldn't fly ... also if it isn't ClearAllChildren what would i put??? FinickOdre123 6 — 9y
0
Updated. Validark 1580 — 9y
Ad

Answer this question