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

It is possible to have a custom animation per team?

Can someone script a custom animation per team? Just a script. I can read and understand a script but I'm able to right correctly so please help me if possible.

2 comments

0

animation of what >:(

0

@ImKirda Walk animation of a player in a certain team. For example zombie walk in red while Robot walk for blue team.

1 answer

✓ Accepted answer

can be can be, have Script in ServerScriptService:

local Players = game:GetService("Players")
local Teams = game:GetService("Teams")

local RUN_ANIMATIONS = {
    [Teams.Zombie] = "rbxassetid://0000000000",
    [Teams.Robot] = "rbxassetid://0000000000"
}

local function On_Character_Added(player, character)
    local run_animation = RUN_ANIMATIONS[player.Team]
    if not run_animation then return end

    -- beautiful code ain't it

    character
        :WaitForChild("Animate")
        :WaitForChild("run")
        :WaitForChild("RunAnim").AnimationId = run_animation
end

local function On_Player_Added(player)
    player.CharacterAdded:Connect(function(character)
        On_Character_Added(player, character)
    end)
end

Players.PlayerAdded:Connect(On_Player_Added)

note: this only updates the animation after respawn

3 comments

0

Yeah it is, it's easy to read too. Big thanks.

0

Hhhmm, sorry to ask but can you add a custom idle per team too?

0

yes you can

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