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

How do I Program Fire Breath?

Asked by 6 years ago

So far I'm trying to replicate the quirk: Fire Breath. So far, it plays an animation and then creates a new (invisible) part with the Fire effect on it. My plan is to make it move back and forth as to simulate Fire Breath, but is this really the best way of replicating this quirk?

Is there any way to spray fire without having to use parts like the Ye Old Fire Breath Potion? If you would like to see my code, (unfinished), you can see it here.

    if QuirkRarityRating == 1 then
        Quirk = math.random(1,2)
        if Quirk == 1 then
            Quirkname.Text  = ( "Fire Breath" )                     -- Creation
            print("Fire Breath")
                ser=game:GetService("UserInputService")
                ser.InputBegan:connect(function(Key,GME)
            if GME then return end
                if Key.KeyCode == Enum.KeyCode.Z and Cooldown == 0 then
                        -- Animation
                        local Cooldown = 1
                        firebreath.AnimationId = "rbxassetid://865156625"
                        local firebreathSpray = Hum:LoadAnimation(firebreath)
                        firebreathSpray:Play()
                        -- Firebreath Generation
                        FireBreathFlames = Instance.new("Part",Workspace)
                        FireBreathFlames.Name = ("FireBreath")
                        FireBreathFlames.Transparency = 1
                        local FireEffect = Instance.new("Fire")
                        FireEffect.Parent = game.Workspace.FireBreath   
                        wait(1.5)
                        firebreathSpray:Stop()  
                        wait(0.5)
                        local Cooldown = 0
                        workspace.FireBreath.Fire:Destroy()
                        workspace.FireBreath:Destroy()  
                  end       
            end)
        end

It plays an animation, creates a new part (it doesn't change locations yet) and sets it on fire setting its transparency to 1.

0
Can you check your roblox messages? XxmanwolfxXalt -2 — 6y

1 answer

Log in to vote
1
Answered by 6 years ago

If you want to simulate the Fire Breath quirk instead of using roblox's fire particle you could use custom particles. Just remember, you won't be able to make the particles deal damage, I suggest making a hit box the same size as the particles and them make that hit box deal the damage.

I made a custom particle that I think resembles Fire Breath: (Note: it does not move with the player or face the same direction as the player, it just creates the particle at the player head when E is pressed)


local plr = game.Players.LocalPlayer local char = plr.Character local hum = char.Humanoid function onKeyPress(inputObject, gameProcessedEvent) if inputObject.KeyCode == Enum.KeyCode.E then -Create Part local fire = Instance.new("Part",workspace) fire.CFrame = char.Head.CFrame fire.Orientation = Vector3.new(0,0,90) fire.Size = Vector3.new(0.5, 0.5, 0.5) fire.Transparency = 1 fire.CanCollide = false fire.Position = char.Head.Position + Vector3.new(0,-1.5,0) fire.Anchored = true fire.Parent = char.Head local part = Instance.new("ParticleEmitter", fire) part.Color = ColorSequence.new(Color3.new(225,0,0), Color3.new(253,95,15),Color3.new(17,17,17)) part.LightEmission = 0.3 part.LightInfluence = 1 part.Size = NumberSequence.new(1.09,1.06) part.Texture = "rbxassetid://566194599" part.Transparency = NumberSequence.new(0,0.4) part.Name = "PartleEmitter" part.LockedToPart = true part.Lifetime = NumberRange.new(3,4) part.Rate = 100 part.Rotation = NumberRange.new(50,50) part.RotSpeed = NumberRange.new(50,50) part.Speed = NumberRange.new(20,20) part.VelocitySpread = 20 part.Parent = fire end end game:GetService("UserInputService").InputBegan:connect(onKeyPress)
0
It won't work so i configured your script.. greatneil80 2647 — 6y
0
Thank you so much! I'll try this. Another thing I was wondering was how to make something teleport to your body, but looking over the script, I get it now! OrcaTheFish 95 — 6y
0
You're welcome! I'm glad I could help!! If you want too, accepting my answer helps a lot! roblox99456789 104 — 6y
1
the script didnt work because on line 8 there is only one "-" when he meant to use two "--" 's To make a note saying "create part" if you add in the second "-" the script will work.. :) XxmanwolfxXalt -2 — 6y
Ad

Answer this question