Basically, I have a weapon where if you press a button on the keyboard, it ignites or turns on, the particle emitter activates, a sound is played, and an idle animation starts.
When I turn it off, all of these things turn off, but for some reason I'm still stuck in the pose of my animation, even when the weapon is turned off
Can someone help?
function ignite()
local saberidle = script.Parent.Parent.Parent.Humanoid:LoadAnimation(animation.saberidle)
for _,v in pairs (emitter:GetChildren()) do
if v.Enabled == false then -- Turn On
v.Enabled = true
ignitesound:Play() -- Sound
idlesound:Play() -- Sound
saberidle:Play() -- Animation
return
end
if v.Enabled == true then -- Turn Off
v.Enabled = false
disignitesound:Play() -- Sound
idlesound:Stop() -- Sound
saberidle:Stop() -- Animation
return
end
end
end
Edit: All the variables shown have already been set so thats not a problem
