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

Still no solution base model rthro is not animating when i prees the f key?

Asked by 5 years ago

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?

0
You need to load the animation outside of your event. BlueGrovyle 278 — 5y

1 answer

Log in to vote
0
Answered by 5 years ago

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.

0
Thanks that worked I have been struggling with that for so long, i have had several people answer my question but nobody was correct thanks for knowing your stuff! Army31LemaMike 0 — 5y
0
no problem ahsan666666666666 264 — 4y
Ad

Answer this question