Hi, I want to make a knife but my animation doesn't load.. Why and how to fix?
This is in a ClientScript put in a Tool
--< Services local PlayerService = game:GetService('Players') local UserInputService = game:GetService('UserInputService') --< Variables local ToolS = script local Tool = ToolS.Parent local Player = PlayerService.LocalPlayer local IsEquip = false local LastAnim = {} --< Functions local function FindAnimation(player) for index, animation in pairs(Tool.Handle.Slashs:GetChildren()) do if LastAnim[1] ~= animation then LastAnim[1] = animation return animation, Tool.Handle.Sounds:GetChildren()[math.random(1, #Tool.Handle.Sounds:GetChildren())] end end end --< Events Tool.Equipped:Connect(function() IsEquip = true end) Tool.Unequipped:Connect(function() IsEquip = false end) UserInputService.InputBegan:Connect(function(input) if input.UserInputType == Enum.UserInputType.MouseButton1 and IsEquip then local Anim, Sound = FindAnimation() if Anim then print(Anim.Name, Sound.Name) local AnimationTrack = Player.Character.Humanoid:LoadAnimation(Tool.Handle.Slashs[Anim.Name]) AnimationTrack:Play() Sound:Play() end end end)
Hi, I had the same problem but I got it fixed.
Who owns the game? You or a group? If it is you who owns the game, you must export the animation into YOUR profile. If it is a group that owns the game, the animation must be exported into THE GROUP. Roblox, for some reason, doesn't allow animations from another person in a game.