local hum = game:GetService("Players").LocalPlayer.Character:FindFirstChild("Humanoid")
local anim = Instance.new("Animation")
anim.Parent = script
anim.AnimationId = "rbxassetid://3130655499"
game:GetService("UserInputService"):Connect(function(i,gpe)
if gpe == false and i.KeyCode == Enum.KeyCode.F then
hum:LoadAnimation(anim):Play()
end
end)
this is the script i am using and the animation is the one I made, I am new with rthro and i haven't had any success this month with animations playing, and I really want to learn how to do this can someone show me a well put together explanation or point out my mistakes?
if you are trying to play a animation when you press a key such as f you first need to have a local script inside of
starterPlayer.starterCharacterScript
in side the local script you can paste the script
local player = game.Players.LocalPlayer local db = true local anim = instance.new("Animation") anim.AnimationId = "http://www.roblox.com/asset/?id=3130655499" game:GetService("UserInputService").Input:Connect(function(input, event) if input.KeyCode == Enum.KeyCode.F and db then db = false local playAnim = game.Players.LocalPlayer.Character:WaitForChild("Humanoid"):LoadAnimation(anim) playAnim:Play() wait(0.8) db = true playAnim:Stop() end end)
after inserting this script if you click f the animation will load also dont change the animation id ive set it to your id allreadyso you dont need to bother it.
if you have any problems just ask.