could i have some help with the eating animation with tool/food in hand?
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:
01 | local animation = Instance.new( "Animation" ) |
04 | local trackanimation = nil |
05 | local playability = true |
06 | function playAnimation(AnimationSource) |
07 | if playability = = true then |
08 | local plr = game.Players.LocalPlayer |
09 | trackanimation = plr.Character.Humanoid:LoadAnimation(animation) |
11 | trackanimation.KeyframeReached:connect( function () |
18 | local Player = game.Players.LocalPlayer |
19 | local Mouse = Player:GetMouse() |
20 | local waituntilback = script.Parent.Parent.Hamburger.Equipped:connect() |
22 | script.Parent.Parent.Hamburger.Equipped:connect( function () |
23 | if not script.Parent.Parent.Hamburger.Equipped:connect() then |
24 | playAnimation(waituntilback) else |
is something wrong about it?