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

how do I make a animation go into a players humanoid when they join?

Asked by 6 years ago

this is what I have but I'm not sure what to make the parent as to put it into there humanoid if they join

local function onPlayerAdded(player)
    local animation = Instance.new("Animation")
    animation.Parent = 
    animation.Name = "Animation"
    animation.AnimationId = "https://www.roblox.com/catalog/1222831397"
end


game.Players.PlayerAdded:connect(onPlayerAdded)

2 answers

Log in to vote
0
Answered by
Goulstem 8144 Badge of Merit Moderation Voter Administrator Community Moderator
6 years ago
Edited 6 years ago

You don't need a parent to play the animation ;)

You can parent it to the Player if you'd like..

But you do need to:

  • Use the LoadAnimation and AnimTrack:Play functions.

  • Make sure the AnimationID is valid and something the game creator owns.

  • Make sure the game has time to load the anim before trying to use the Play function

Ad
Log in to vote
0
Answered by 6 years ago
Edited 6 years ago

Try this script.But its only for walking and jumping so

This script must be put in StarterGui

wait(0.01)

local player = game.Players.LocalPlayer




local character = player.Character or player.CharacterAdded:wait() 

local animate = character.Animate 


-------EDIT ONLY THESE THINGS BELOW!!!!


animate.walk.WalkAnim.AnimationId = "rbxassetid://1221236212" -- Walking 
animate.jump.JumpAnim.AnimationId = "rbxassetid://1213202407" -- Jumping

Answer this question