I'm making a dragon game where you press a button to breathe fire and my particle emitter isn't working. Please help!
Here's a sample of my LocalScript in StarterGui
local colorone = Color3.new(255,95,2)
local colortwo = Color3.new(255,255,255)
print("Start of Script")
local fireBreath = Instance.new("ParticleEmitter",game.StarterPlayer.StarterCharacter.Mouth)
fireBreath.Color = ColorSequence.new(colorone,colortwo)
fireBreath.Lifetime = NumberRange.new(10,10)
fireBreath.Rate = 500
fireBreath.Speed = NumberRange.new(60,60)
fireBreath.SpreadAngle = Vector2.new(20,20)
fireBreath.Texture = "rbxassetid://178636145"
fireBreath.EmissionDirection = 5
fireBreath.LockedToPart = true
fireBreath.Enabled = true
game:GetService("UserInputService").InputBegan:connect(function(input,gameprocessed)
if input.KeyCode==Enum.KeyCode.LeftShift then
for i = 1,16 do
wait()
fireBreath.Enabled = true
end
end
end)
game:GetService("UserInputService").InputEnded:connect(function(input,gameprocessed)
if input.KeyCode==Enum.KeyCode.LeftShift then
for i = 1,16 do
fireBreath.Enabled = false
end
end
end)

2 comments
Thanks for the help! Now I can turn the "fire" on and off but it's locked to a point where I start the game rather than to the model. The controls and camera follow the dragon model but the fire stays connected to point on the ground where I started. Still learning here :) EDIT: Figured it out! I can change the parent to be a part on the model rather than just character! You rock chomboghai!!
Yeah, I just changed my code because I realized the mistake. And thanks! I hope your development goes well!