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

It is possible to have a custom animation per team?

Asked by 1 year ago

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.

0
animation of what >:( imKirda 4491 — 1y
0
@ImKirda Walk animation of a player in a certain team. For example zombie walk in red while Robot walk for blue team. AltairCelestia 47 — 1y

1 answer

Log in to vote
0
Answered by
imKirda 4491 Moderation Voter Community Moderator
1 year ago
Edited 1 year ago

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

0
Yeah it is, it's easy to read too. Big thanks. AltairCelestia 47 — 1y
0
Hhhmm, sorry to ask but can you add a custom idle per team too? AltairCelestia 47 — 1y
0
yes you can imKirda 4491 — 1y
Ad

Answer this question