Problems with Animation Script

For almost the entire evening, I have been working on a script that plays an animation, then starts playing a short one in a loop. The problem is, the animations stop all of a sudden, which happens to me a-lot. Would I have to anchor the player or disable the idle animation in order to keep the animations I have playing? And if so, how would I apply it to my script? I have tried using user.anchor = true, but an error shows up, reading "Anchor is not a valid member of “Players.LuxSemper”. Same thing happened when I tried anchoring the char or humanoid. I looked around the forums for a while, before deciding that none of the results were helping very much. I’m not very advanced in Lua scripting, and I’m not the brightest person.

Here is my entire script:


local start = game.Players.LocalPlayer.Character.Humanoid:LoadAnimation(script.Parent.start)
local float = game.Players.LocalPlayer.Character.Humanoid:LoadAnimation(script.Parent.float)
local complete =game.Players.LocalPlayer.Character.Humanoid:LoadAnimation(script.Parent.complete)
local fail = game.Players.LocalPlayer.Character.Humanoid:LoadAnimation(script.Parent.fail)
local user = game:GetService("Players").LocalPlayer
local theme = game.SoundService.theme
local erasure = game.SoundService.player_erasure

script.Parent.Equipped:Connect(function(Mouse)
	Mouse.Button1Down:Connect(function()
		wait(2)
		start:Play() -- Above this is where I want to disable the animation, or anchor the character. 
		theme:Play()
		for counter = 1, 74 do -- The repeating animation is in this counter. 
			float:Play()
			wait(2)
		end
		complete:Play()
		erasure:Play()
		for i, v in ipairs(game.Players:GetPlayers()) do
			local humanoid = v.Character.Humanoid
			humanoid.Health = 0
		end
	end)
end)

script.Parent.Unequipped:Connect(function()
	fail:Play()
	wait(0.2)
	if user.Character and user.Character:FindFirstChild("Humanoid") then
		user.Character.Humanoid.Health = 0
	end
end)

You need to set the animation priorities respectively.

1 Like

Do you mean adding more wait() statements? The animation labeled “start” is 2 seconds, and the one labeled “float” is also 2.

Edit: You can set this with a script but you will have to do it with every script loading the animation or you can set it directly in the Roblox Animation Editor Plugin.

1 Like

Alright, thanks. This should over-ride the default animations if I set it to action, then, correct?

Yes, it will override all animations.

1 Like