my group is making a restaurant game and i am making a animation and script for if the food is equip and mouse1down/click then the animation will play and the tool will go with it. but the animation does not play. but when i dont equip it and press mouse1 the animation does play. Heres my script:
local animation = Instance.new("Animation")
animation.AnimationId = "https://www.roblox.com/Asset?ID=1069941509"
local trackanimation = nil
local playability = true
function playAnimation(AnimationSource)
if playability == true then
local plr = game.Players.LocalPlayer
trackanimation = plr.Character.Humanoid:LoadAnimation(animation)
trackanimation.KeyframeReached:connect(function()
print ('Working')
end)
trackanimation:Play()
end
end
local Player = game.Players.LocalPlayer
local Mouse = Player:GetMouse()
local waituntilback = script.Parent.Parent.Hamburger.Equipped:connect()
script.Parent.Parent.Hamburger.Equipped:connect(function()
if not script.Parent.Parent.Hamburger.Equipped:connect() then
playAnimation(waituntilback) else
playAnimation()
end
end)
any help please?

9 comments
Playing an event? Just, I'm just gonna exit of this tab.
Really appreciate if you tell me what i am doing wrong not just leave. this is why i posted this
I cannot help a person if I don't know what they are trying to accomplish.
at least tell me why its not working, or just don't comment back
I did tell you why it is not working. "Playing an event?" says it all
be more specific
Your trying to play an event like it is an animation.
is the animation r15 or r6 make sure you are playing the animation on the correct RigType
Can you please explain what line 20's variable supposed to do?