Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

could i have some help with the eating animation with tool/food in hand?

Asked by 6 years ago

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?

0
Well. It does work so it wont play without the food. but the animation wont play when there is a tool and its hand Mohawkid14 28 — 6y
0
all it does it that it only play animation when you un-equip it Mohawkid14 28 — 6y
0
If you used normal Roblox Animation editor then the plugin will ignore tools and your hand with the tool will be frozen Lolamtic 63 — 6y
0
So I have to use a different animation editor? Mohawkid14 28 — 6y
View all comments (3 more)
0
No, the ROBLOX animation editor works perfectly fine. Make sure when you're creating the animation that you only have the selected limbs that you're using. Also, just be sure your tool is also anchored (I doubt you left it anchored but I might as well mention it). Troidit 253 — 6y
0
i have anchored it, the animation won't move with tool. all i need is the animation to move with the tool equipped. Mohawkid14 28 — 6y
0
is my script wrong? Mohawkid14 28 — 6y

Answer this question