Hey, can someone tell me why this ain't workin?

Hey, I was wondering why this animation won’t work.

I’m trying to get the idle animation to work but it won’t can anyone help me fix it?

image

[Animation script]

wait(.3)

local plr = game:GetService(‘Players’).LocalPlayer
local char = plr.Character
local hum = char.Humanoid

local Idle = hum:LoadAnimation(script.Parent.Idle)

script.Parent.Equipped:Connect(function()
Idle:Play()
end)

script.Parent.Unequipped:Connect(function()
Idle:Stop()
end)

Script to make work
local s = script.Parent
local Handle = s:WaitForChild(‘Handle’)
local Sound = Handle:WaitForChild(‘Sound’)
local lightpart = s:WaitForChild(‘Part’)

local Activatedd = false

s.Activated:Connect(function()
if not Activatedd then
Sound:Play()
lightpart.Material = Enum.Material.Neon
Activatedd = true
for i,v in pairs(lightpart:GetChildren()) do
v.Enabled = true
end
elseif Activatedd then
Sound:Play()
lightpart.Material = Enum.Material.Metal
Activatedd = false
for i,v in pairs(lightpart:GetChildren()) do
v.Enabled = false
end
end
end)

this is what it looks like. It’s supposed to play this animation “4461286827”

Is the animation in the game owner’s inventory? If it is not in the game owner’s inventory (user or group), it may not load.

As well to keep in mind, for next help topics, I suggest you to make a specific name, so others can seek by the title. Also, you can select the whole chunk of code to format, instead of just one line.

Use the Animator to Load Animations.

local function playAnimationFromServer(character, animation)
	local humanoid = character:FindFirstChildOfClass("Humanoid")
	if humanoid then
		-- need to use animation object for server access
		local animator = humanoid:FindFirstChildOfClass("Animator")
		if animator then
			local animationTrack = animator:LoadAnimation(animation)
			animationTrack:Play()
			return animationTrack
		end
	end
end

From: Animator | Documentation - Roblox Creator Hub

@hauntedzx,

You used the deprecated: ....Humanoid:LoadAnimation()

You must use: ....Humanoid.Animator:LoadAnimation()

2 Likes

Alrighty, so I did a little research and that animation is owned by Star Route Studios and I see that you are a member of that group. I assume that since you are only a member you do not have the ability to edit any of the group’s games.
If this is the case then the animation won’t work for you because you do not own the animation and will have to create your own.

If by chance you do have edit access and you’re working on a game for the group and that game is published by the group then your issue may be the animation’s priority setting.


As you can see in this photo, the default priority is “Core” which is the lowest priority. You’ll want to use something higher than that, possibly even “Movement” or “Action” depending on what you’re trying to accomplish. Remember, even default movement animations have their own priorities so you’ll want a high enough priority to override them.

@Araknala, I was not aware that that was deprecated so I learned something new today. It should still work though even though it’s deprecated. It’s just not a good idea to continue using it.

Alright. That group is a group for a game I used to play. This is not my flashlight my friend “Jupiful” inserted it. I don’t know why he would have assets from the group though.

The game using the animation must have ownership of it. (profile inventory, or group inventory)