Hi i have this tool which when equipped plays an animation on a character
and then when it is unequipped, it plays another animation(most specificly the animation it had before the tool was equipped)
the problem is, the animation playing when unequipped doesnt play. It only plays on the server and not the client somehow.
I wanted the animation to be seen by other players and not locally
here’s the script:
local tool = script.Parent.Parent
tool.Equipped:Connect(function()
local player = tool.Parent
local kbot = workspace:WaitForChild(player.Name.."'s K-BOT")
local animator = kbot:WaitForChild("Humanoid").Animator
local animations = {
['Power'] = {
['animation'] = animator:LoadAnimation(kbot.animations.Power),
['face'] = function()
kbot.face.BrickColor = BrickColor.new('Really red')
end}
}
local loadAnimation = animations['Power']['animation']
loadAnimation.Priority = Enum.AnimationPriority.Action
loadAnimation.Looped = true
loadAnimation:Play()
animations['Power']['face']()
end)
tool.Unequipped:Connect(function()
local player = tool.Parent.Parent
local kbot = workspace:WaitForChild(player.Name.."'s K-BOT")
local animator = kbot:WaitForChild("Humanoid").Animator
local animations = {
['Idle'] = {
['animation'] = animator:LoadAnimation(kbot.animations.Idle),
['face'] = function()
kbot.face.BrickColor = BrickColor.new('Electric blue')
end}
}
local loadAnimation = animations['Idle']['animation']
loadAnimation.Priority = Enum.AnimationPriority.Action
loadAnimation.Looped = true
loadAnimation:Play()
animations['Idle']['face']()
end)
video: