What do you want to achieve? A simple drink with an animation
What is the issue? the animation isn’t working
here’s the code:
local Tool = script.Parent
local Anim = Tool.Animation
Tool.Activated:Connect(function()
local Character = Tool.Parent
local Humanoid = Character.Humanoid
local AnimationTrack = Humanoid:LoadAnimation(Anim)
AnimationTrack:Play()
end)
SOME BACKGROUND INFO:
it’s for a cafe game and there’s multiple parts to the coffee, plus there’s a coffee making system so it starts off a regular cup and when you hold it over the sensor (coffee maker) the coffee part’s transparency is set to 0.
Check whether or not the character is anchored, welded or another animation is playing over with a higher priority. Also, make sure the Rig is compatible.
First off you need the animation Id. After that then you input it into the code like this:
Tool.Activated:Connect(function()
local Anim = Instance.new('Animation')
Anim.AnimationId = 'rbxassetid://--Your Id Goes here'
PlayAnim = Character.Humanoid:LoadAnimation(Anim)
PlayAnim:Play()
end
Edit: Put this in a local script inside StarterCharacterScripts Lemme know what happened @hopeshusbvnd I’m curios. Wait a minute this might not work gimme a sec.
local Tool = script.Parent
local Animation = --toolname goes here .Animation
Tool.Activated:Connect(function()
local Anim = Instance.new('Animation')
local Character = Tool.Parent
local Humanoid = Character.Humanoid
local AnimationTrack = Humanoid:LoadAnimation(Animation)
Anim.AnimationId = 'rbxassetid://--ID goes here'
AnimationTrack:Play()
end)
Also add a animation inside your tool click the animation the click the animation value then put the animation in their and your done.