Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

How do I make it so StarterCharacter has custom anims?

Hey! So I've been trying to make a mage or something close to it and I can't seem to find a way to make my Mage StarterCharacter have different animations from the other characters (Run/walk, jump, idle, etc)

local animNames = { 
	idle = 	{	
		{ id = "http://www.roblox.com/asset/?id=6753601536", weight = 1 },
		{ id = "http://www.roblox.com/asset/?id=6753601536", weight = 1 },
		{ id = "http://www.roblox.com/asset/?id=6753601536", weight = 9 }
			},
	walk = 	{ 	
		{ id = "http://www.roblox.com/asset/?id=6753646173", weight = 10 } 
			}, 
	run = 	{
		{ id = "http://www.roblox.com/asset/?id=6753646173", weight = 10 } 
			}, 
	jump = 	{
		{ id = "http://www.roblox.com/asset/?id=6753680952", weight = 10 } 
			}, 
	fall = 	{
		{ id = "http://www.roblox.com/asset/?id=6753712335", weight = 10 } 
			}, 
-- Only the important part of the LocalScript

When I put my LocalScript with anims in StarterCharacterScripts it will work with every single startercharacter

1 answer

The script should be called Animate & placed in StarterPlayer.StarterCharacterScripts. This will override the default script used for animations.

If you're having custom animations, that's where code blocks come in. You create if-statements on player teams & other definitions. Depending on the response of those if-statements, you can modify/change the animation id in the table.

If this isn't happening in real-time (because I haven't tested the script myself), there's always a workaround but I wouldn't worry about it.

local PlayersService = game:GetService("Players")

if PlayersService.LocalPlayer.Team.Name == "TeamName" then
    animNames["idle"]["id"] = "rbxassetid://0"
end

2 comments

0

It's the thing that I'm not the brightest with scripts, and I need it so custom StarterCharacter has custom Anims, because if I put an animate script in startercharacterscripts It will put every startercharacter to have the same anim

0

I updated it with an example

This discussion is preserved as it was. New answers, comments, and votes are closed.