local ReplicatedStorage = game:GetService('ReplicatedStorage')
local TauntTrack = nil
function TauntAction(Character, Value)
if TauntTrack == nil then
return
end
if Value == 'Taunting' then
TauntTrack:Play()
print('yea')
end
if Value == 'NoTaunting' then
TauntTrack.Looped = false
TauntTrack:Stop()
print('no')
end
end
ReplicatedStorage.Remotes.TauntEvent.OnServerEvent:Connect(function(Player:Player, Value)
local Character = Player.Character or Player.CharacterAdded:Wait()
local Humanoid = Character:WaitForChild('Humanoid')
local Animator = Humanoid:WaitForChild('Animator')
local Track = Animator:LoadAnimation(ReplicatedStorage.Animations.Player:WaitForChild('Taunt'))
TauntTrack = Track
print('yea')
task.wait(0.1)
TauntAction(Character, Value)
end)
No error, it works it’s just that the line where it stops the TauntTrack doesn’t stop it