i want to make every player that joins the game, will have the walking,running animation that i want, i first tried to put a script named “animate” in StarterCharacterScripts and just use the regular animate script but just change the ids, it didn’t worked so i tried another way with this script:
game.Players.PlayerAdded:Connect(function(player)
player.CharacterAdded:Connect(function(char)
local humanoid = char:findFirstChild("Humanoid")
if (humanoid) then
local Run = 658830056
local Walk = 658831143
local Fall = 658831500
local Jump = 658832070
local Idle = 658832408
local Swim = 658832807
local Climb = 658833139
local anim = char.Animate
local animation = anim:FindFirstChild("walk")
local children = animation:GetChildren()
for index, child in pairs(children) do
child:Remove()
end
local newanim = Instance.new("Animation")
newanim.Parent = animation
newanim.Name = 'Anim'
newanim.AnimationId = 'http://www.roblox.com/asset/?id='..Walk
end
end)
end)
and it still won’t work, is there a easier and working way to do this?
There is something called a humanoid description that you could use, I’d provide a link to the page but I’m on mobile right now. Should be somewhere on the api reference.
in the character why not try editing the animation values instead, for example under run you would have runAnim just change the animation ID through a local script
I don’t think thats possible, you’ll have to change the animation Id directly from where its playing the animation at which is essentially the animate script.
There a intvalues/numbervalues and inside that are the animations which are inside the script aswell that you’ll have to change to the same ID I’m pretty sure.
local humanoid = player.Character and player.Character:FindFirstChild("Humanoid")
if humanoid then
local descriptionClone = humanoid:GetAppliedDescription()
descriptionClone.IdleAnimation = 754637456
-- Apply modified "descriptionClone" to humanoid
humanoid:ApplyDescription(descriptionClone)
end
It checks if there’s a humanoid, and if there is, it’ll get the description and change the idle animation to whatever that id is,
You can read more about it on the actual page.
where i suppose to place the script? and if i’m placing it inside ServerScriptService, why is that won’t work?
game.Players.PlayerAdded:Connect(function(player)
player.CharacterAdded:Connect(function(char)
local humanoid = char and char:FindFirstChild("Humanoid")
if humanoid then
local descriptionClone = humanoid:GetAppliedDescription()
descriptionClone.WalkAnimation = 734326330
-- Apply modified "descriptionClone" to humanoid
humanoid:ApplyDescription(descriptionClone)
end
end)
end)
I do it this way,
I went in a play solo and grabbed the Animate Script from out of my character.
I edited values that I wanted to change, pretty simple.
REMEMBER TO MOVE YOUR COPY INTO STARTER CHARACTER SCRIPTS
Copy paste it into starter character scripts
Open it up
Scroll down till you find the one you want then open it and click the animation!