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

? about a fly again just with particles

Asked by 9 years ago

Okay, so i know that this kills me cause of the ClearAllChildren part in the Torso but i don't know what to do to change that any help there is appreciated. Secondly ... how do i make it so i can use my own particle and not the default star shape. Because i don't want the star while I'm flying so if you know how to make the particle use my own decal that would be appreciated thank you, ~Fin

function Fly()

01if Flying and Player and Torso and Humanoid and Humanoid.Health > 0 then
02 
03    local Momentum = Vector3.new(0, 0, 0)
04    local LastMomentum = Vector3.new(0, 0, 0)
05    local LastTilt = 0
06    local CurrentSpeed = Speed.MaxSpeed
07    local Inertia = (1 - (Speed.CurrentSpeed / CurrentSpeed))
08    fire=Instance.new("ParticleEmitter")
09    fire.Parent=script.Parent.Parent["Left Leg"]
10    fire2=Instance.new("ParticleEmitter")
11    fire2.Parent=script.Parent.Parent["Right Leg"]
12    fire3=Instance.new("ParticleEmitter")
13    fire3.Parent=script.Parent.Parent["Left Arm"]
14    fire4=Instance.new("ParticleEmitter")
15    fire4.Parent=script.Parent.Parent["Right Arm"]
View all 82 lines...

end

function StopFlying() Flying = false BodyVelocity.maxForce = Vector3.new(0, 0, 0) BodyPosition.maxForce = Vector3.new(0, 0, 0) BodyGyro.maxTorque = Vector3.new(0, 0, 0) script.Parent.Parent["Left Leg"]:ClearAllChildren() script.Parent.Parent["Right Leg"]:ClearAllChildren() script.Parent.Parent["Left Arm"]:ClearAllChildren() script.Parent.Parent["Right Arm"]:ClearAllChildren() script.Parent.Parent.Torso:ClearAllChildren() script.Parent.Parent.Head:ClearAllChildren() end

1 answer

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

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

Here is a list of all the properties of ParticleEmitter. To change the Texture, modify the Texture property.

0
ok ... thank you ill try that FinickOdre123 6 — 9y
0
i tryed that and it didnt work ... did i do it wrong? FinickOdre123 6 — 9y
Ad

Answer this question