hey everyone i have problem with this animation team script i cant make it so if one player is in team 1 to do animation team 1 it says this
local character = script.Parent
local humanoid = character:WaitForChild("Humanoid")
local player = game.Players.PlayerAdded
local Teams = game:GetService("Teams")
--get player
local idleShadowAnim = script:WaitForChild("IdleShadow")
local ShadowWalkAnim = script:WaitForChild("ShadowWalk")
local walkAnim = script:WaitForChild("Walk")
local ShadowWalkAnimTrack = humanoid.Animator:LoadAnimation(ShadowWalkAnim)
local idleSAAnimTrack = humanoid.Animator:LoadAnimation(idleShadowAnim)
local walkAnimTrack = humanoid.Animator:LoadAnimation(walkAnim)
--get anims
local survivorbol = Instance.new("BoolValue")
survivorbol.Parent = script
survivorbol.Value = false
local shadowbol = Instance.new("BoolValue")
shadowbol.Parent = script
shadowbol.Value = false
--;
player:Connect(function(player)
if player.Team == Teams.Shadow then
shadowbol.Value = true
else
survivorbol.Value = true
end
end)
if player.Teams == Teams.Shadow then
shadowbol.Value = true
else
survivorbol.Value = true
end
humanoid.Running:Connect(function(speed)
if speed > 0 then
if shadowbol.Value == true then
ShadowWalkAnimTrack:Play()
idleSAAnimTrack:Stop()
elseif survivorbol.Value == true then
walkAnimTrack:Play()
idleShadowAnim:Play()
else
print("notvalue")
end
else
if shadowbol.Value == true then
idleSAAnimTrack:Play()
ShadowWalkAnimTrack:Stop()
elseif survivorbol.Value == true then
print("didntstop?")
else
end
end
end)
--