I’m really new to the dev forum, and I’ve been looking to start scripting and creating my own game for awhile now, and I’m trying to achieve custom animations for these classes/races that I’ve made up within a loot table using weights and a datastore. I’ve already used the Animate script in StarterCharacterScripts, I don’t know how to replicate it onto other “races” though.
I haven’t found a way to do this yet, which is why I’m now making a post about this to perhaps answer this question. Here’s an example of what I’m talking about.
Player B gets Human, which has the default animation pack.
Player A gets Goblin, which has a separate animation pack to make it feel more goblin-y.
How exactly would I be able to script this using my main script handling races etc. ?
Currently, I’ve stated previously that I tried to search this up on the web and found no results, and I looked into a few dev forum posts, but it was only for custom tool animations, and the basic Animate script that I’ve already put into StarterCharacterScripts.
Here’s the code handling the weight / loot table.
local loot = {
{Item = 'Human', Weight = 35},
{Item = 'Dwarf', Weight = 30},
{Item = 'Giant', Weight = 30},
{Item = 'Goblin', Weight = 25},
{Item = 'Vin', Weight = 25},
{Item = 'Draugr', Weight = 20},
{Item = 'Eidrich', Weight = 14},
{Item = 'Zielich', Weight = 2},
{Item = 'Oron', Weight = 0.5},
}
Here is my human + goblin script.
if race == 'Human' then
changeBColor(player.Character:WaitForChild("Body Colors"), "Light red")
elseif race == 'Goblin' then
character.Humanoid.WalkSpeed = 14
setSize(character, 0.85)
character.Humanoid.MaxHealth = 70
character.Humanoid.Health = 70
changeBColor(player.Character:WaitForChild("Body Colors"), "Grime")