local player = game.Players.LocalPlayer
local char = player.Character or player.CharacterAdded:Wait()
local anim = script.Parent:WaitForChild("Equip")
local EquipAnim = char:WaitForChild("Humanoid"):LoadAnimation(anim)
local tool = script.Parent
tool.Equipped:Connect(function()
EquipAnim:Play()
print("Anim played")
end)
tool.Unequipped:Connect(function()
EquipAnim:Stop()
print("Anim stopped")
end)
The animation is only being played locally (Or on your side), which is why you’re only able to see it others cannot
It is actually possible to fix this by changing your script to a Server Script instead & defining the Character using script.Parent.Parent & doing a bit of global/local variables:
local Tool = script.Parent
local Anim = Tool:WaitForChild("Equip")
local Character
local Animator
local EquipAnim
Tool.Equipped:Connect(function()
Character = Tool.Parent
Animator = Character:WaitForChild("Humanoid"):WaitForChild("Animator")
EquipAnim = Animator:LoadAnimation(Anim)
print("Anim played")
EquipAnim:Play()
end)
Tool.Unequipped:Connect(function()
print("Anim stopped")
EquipAnim:Stop()
end)
Since Tool.Unequipped will parent the Tool to the Player’s Backpack, we can instead reference the Character using Tool.Equipped using global variables inside our Events
local Tool = script.Parent
local Anim = Tool:WaitForChild("Equip")
local Character
local Animator
local EquipAnim
Tool.Equipped:Connect(function()
Character = Tool.Parent
Animator = Character:WaitForChild("Humanoid"):WaitForChild("Animator")
EquipAnim = Animator:LoadAnimation(Anim)
print("Anim played")
EquipAnim:Play()
end)
Tool.Unequipped:Connect(function()
print("Anim stopped")
EquipAnim:Stop()
end)
If your friend owns the place, you won’t be able to play the animation ingame so you need to ask your friend to publish the animation instead for it to work
I don’t know how Moon Animator works but I’m assuming as long as you are able to save the file, you & your friend both have access to it & can publish it through the Animator, you should be fine I believe?