So. me and a group are making a restaurant game but i want it that if the player has the food they click the left mouse. And the animation only plays if the burger is in hand. But the animation doesn't move. here is the 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)
is something wrong about it?