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

How do I put a proning animation right after the diving animation?

Asked by 7 years ago
Edited 7 years ago

Okay, so this plays an animation if you press spacebar. The animation is a diving animation, so you land on the ground once it completes (aka prone position). I need help with adding a part where it plays the prone animation right after the diving and it must look seamless, I also need help adding a key so it goes back into the normal standing up when you're prone. Feel free to use the code so you can test it out.

Edit: I know the animation doesn't work because Roblox doesn't allow sharing animations but if you can add in the proning script part with the stand normal key, I can make the proning animations later.

--Put in StarterGUI
--and get the player and character and humanoid
local player = game:GetService("Players").LocalPlayer
local character = player.Character or player.Character:Added()
local humanoid = character:WaitForChild("Humanoid")
--Next we make our animation
local anim = Instance.new("Animation")
anim.AnimationId = "rbxassetid://1352848282"
--Now we can make a function to play animations!
function playAnimation(Anim)
    local track = humanoid:LoadAnimation(Anim)
    track:Play()
end
--Now we play it when using the userinputservice
game:GetService("UserInputService").InputBegan:connect(function(input ,proc)
    if not proc then
        if input.KeyCode == Enum.KeyCode.Space then --get the F key using Enum
            playAnimation(anim) --plays our animation using our function :)
        end
    end
end)

Answer this question