How can I give a team its own walk and idle animations?
I have this script in server script service that changes the walk speed of my zombie team. I want my zombie team to have its own idle and walk animations specific to that team. How can I do this? I want to make it so if the zombie isn't moving, it plays the idle animation. When the zombie moves, it plays the walk animation. Please help!
Here's the script:
local Players = game:GetService("Players")
local Team = game:GetService("Teams")["Zombie"]
local function onCharacterAdded(character)
local plr = Players:GetPlayerFromCharacter(character)
1 | if plr.Team = = Team then |
2 | character:WaitForChild( "Humanoid" ).WalkSpeed = 11 |
end
local function onPlayerAdded(player)
1 | if player.Character then |
2 | onCharacterAdded(player.Character) |
5 | player.CharacterAdded:Connect(onCharacterAdded) |
end
Players.PlayerAdded:Connect(onPlayerAdded)