This is the mother of all necro bumps (I know, deal with it ), but this issue appears to have cropped up again. The animations play on the client that tries to play them just fine, but they wonât replicate to other clients.
Using a localscript, animations are located physically under the tool (Animations are loaded/played to the humanoid via a local script). I havenât made any changes, and itâs doing the exact same behavior again. Animations load fine when the game isnât running filtering.
Localscript: [spoiler]
[code]--------------------
â| WaitForChild |â
â Waits for parent.child to exist, then returns it
local function WaitForChild(parent, childName)
assert(parent, âERROR: WaitForChild: parent is nilâ)
while not parent:FindFirstChild(childName) do parent.ChildAdded:wait() end
return parent[childName]
end
â| Variables |â
local g_mouse = nil
local Tool = script.Parent
local ScytheEquipAnimation = WaitForChild(script, âScytheEquip2â)
local ScytheIdleAnimation = WaitForChild(script, âScytheIdle2â)
local ScytheSlashAnimation = WaitForChild(script, âScytheSlashâ)
local ScytheEquipTrack = nil
local ScytheIdleTrack = nil
local ScytheSlashTrack = nil
â| Functions |â
local function OnEquipped(mouse)
âSet the mouse icon to nothing.
g_mouse = mouse
mouse.Icon = âhttp://www.roblox.com/asset?id=18662155â
local myModel = Tool.Parent
local humanoid = myModel:FindFirstChild(âHumanâ)
if humanoid then â Preload animations
ScytheEquipTrack = humanoid:LoadAnimation(ScytheEquipAnimation)
if ScytheEquipTrack then ScytheEquipTrack:Play() end
ScytheIdleTrack = humanoid:LoadAnimation(ScytheIdleAnimation)
if ScytheIdleTrack then ScytheIdleTrack:Play() end
ScytheSlashTrack = humanoid:LoadAnimation(ScytheSlashAnimation)
end
end
local slash_debounce = false
Tool.Activated:connect(function()
if not slash_debounce then
slash_debounce = true
if ScytheSlashTrack then ScytheSlashTrack:Play() end
Tool.Handle.SwordSlash:Play()
wait(.5)
slash_debounce = false
end
end)
local function OnUnequipped(mouse)
â Stop all animations
âSet their mouse icon to the cursor.
g_mouse.Icon = ârbxasset://textures/ArrowFarCursor.pngâ
if ScytheEquipTrack then ScytheEquipTrack:Stop() end
if ScytheIdleTrack then ScytheIdleTrack:Stop() end
if ScytheSlashTrack then ScytheSlashTrack:Stop() end
end
â| Script Logic |â
Tool.Equipped:connect(OnEquipped)
Tool.Unequipped:connect(OnUnequipped)[/code]
[/spoiler]
Picture of the tool layout:
All the animations start with rbxassetid://, and are loaded via the localscript.