Hi, i made two buttons which when clicked, fires a remoteevent(different for each button). And so, when the remoteevent is fired, it’ll play a tween and a color.
watch here: https://gyazo.com/79428b844cddb5132de1fe62cf91733f
the problem is, the idle animation isn’t playing on client side
at the very end, you could see that the idle animation is only playing on server side
does anyone why does this happen?
script if needed
local script if needed:
script.Parent.MouseButton1Click:Connect(function()
local remoteEvent = game.ReplicatedStorage.angry
remoteEvent:FireServer()
end)
serverscript:
local remoteEventA = game.ReplicatedStorage.angry
local remoteEventB = game.ReplicatedStorage.idle
--> angry animation
remoteEventA.OnServerEvent:Connect(function(player)
local kBot = workspace:WaitForChild(player.Name.."'s K-BOT")
local animator = kBot:WaitForChild("Humanoid").Animator
local animations = {
['Hold'] = kBot.animation.Hold,
['Idle'] = kBot.animation.Idle,
['Angry'] = kBot.animation.Angry
}
local ts = game.TweenService
local tween = ts:Create(kBot.face, TweenInfo.new(1), {Color = Color3.new(1, 0, 0)})
tween:Play()
local loadAnimation = animator:LoadAnimation(animations['Angry'])
loadAnimation.Priority = Enum.AnimationPriority.Action
loadAnimation.Looped = true
loadAnimation:Play()
end)
--idle animation
remoteEventB.OnServerEvent:Connect(function(player)
local kBot = workspace:WaitForChild(player.Name.."'s K-BOT")
local animator = kBot:WaitForChild("Humanoid").Animator
local animations = {
['Hold'] = kBot.animation.Hold,
['Idle'] = kBot.animation.Idle,
['Angry'] = kBot.animation.Angry
}
local ts = game.TweenService
local tween = ts:Create(kBot.face, TweenInfo.new(1), {Color = Color3.new(0.0156863, 0.686275, 0.92549)})
tween:Play()
local loadAnimation = animator:LoadAnimation(animations['Idle'])
loadAnimation.Priority = Enum.AnimationPriority.Action
loadAnimation.Looped = true
loadAnimation:Play()
end)