Animation playing problems

Hold on, still testing.‎ ‎ ‎ ‎ ‎ ‎ ‎ ‎ ‎ ‎ ‎ ‎ ‎ ‎ ‎ ‎ ‎ ‎ ‎ ‎

Another error.
21:24:09.165 Players.T0I_C.Backpack.Starter.LocalScript:23: attempt to index nil with ‘Animator’ - Client - LocalScript:23
21:24:09.165 Stack Begin - Studio
21:24:09.165 Script ‘Players.T0I_C.Backpack.Starter.LocalScript’, Line 23 - Studio - LocalScript:23
21:24:09.165 Stack End - Studio
21:24:10.317 MeshContentProvider failed to process https://assetdelivery.roblox.com/v1/asset?id=0 because ‘could not fetch’

local Animation = Instance.new("Animation")
Animation.AnimationId = "rbxassetid://111017572193713"
Animation.Parent = script.Parent
local AnimationTrack = script.Parent:FindFirstChild("Humanoid"):LoadAnimation(Animation)

try this then

That looks the same as the code already typed.

1 Like

21:27:38.236 MeshContentProvider failed to process https://assetdelivery.roblox.com/v1/asset?id=0 because ‘could not fetch’ - Studio
21:27:38.437 Players.T0I_C.Backpack.Starter.LocalScript:23: attempt to index nil with ‘LoadAnimation’
Nothing works.

1 Like

You’re using script.Parent instead of using Humanoid that you’re already defined.

local Tool = script.Parent
local RemoteEvent = Tool:WaitForChild("RemoteEvent")
local Players = game:GetService("Players")
local User = Players.LocalPlayer
local Mouse = User:GetMouse()
local Character = User.Character or User.CharacterAdded:Wait()
local Humanoid = Character:WaitForChild("Humanoid")

Tool.Activated:Connect(function()
    if Tool.Parent.Name == "Backpack" then return end
    local root = Tool.Parent:FindFirstChild("HumanoidRootPart")
    if not root then return end
    RemoteEvent:FireServer((Mouse.Hit.Position - root.Position).Unit)
end)

while Humanoid:IsDescendantOf(workspace) == false do
    Humanoid.AncestryChanged:Wait()
end

local Animation = Instance.new("Animation")
Animation.AnimationId = "rbxassetid://111017572193713"
Animation.Parent = script.Parent
local AnimationTrack = Character.Humanoid.Animator:LoadAnimation(Animation)

Tool.Equipped:Connect(function()
    AnimationTrack:Play()
end)

Tool.Unequipped:Connect(function()
    AnimationTrack:Stop()
end)
3 Likes

All sounds and meshes are gone when i connect, wth did that do??

1 Like

It did nothing relating to the game, it’s something in your game doing it.

1 Like

It didnt do that until i added the new code.

1 Like

Well I didn’t touch anything relating to meshes or sounds, you cann tell by no hints of Destroy are you sure it’s not something else?

Absolutely sure, nothing like that happened before the new code was added. Like, certainly.

Holy moly, meshes and sounds came back after i closed out and came back… Paranormal.

And its fixed! Thanks for the paranormal thing that happened but thats fixed now! Lol! :rofl:

2 Likes

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.