Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

How do I detect when the animationtrack is loaded?

I want to check if a animationtrack is loaded and execute this code:

game.Workspace.jumpscares.Noob:SetPrimaryPartCFrame(game.Workspace.animatronicSpawn.CFrame)
game.Workspace.jumpscares.Noob.HumanoidRootPart.Anchored = true
wait(0.19)
player.PlayerGui.scream:Play()
wait(1.10)
player.PlayerGui.scream:Stop()
player.PlayerGui.gameover.Enabled = true

I already tried using Length and TimePosition but it didn't work.

2 answers

You could check if a track is loaded by true or false bools?

local animation = --the animation here
local animationTrack -- We're not going to load the animation just yet...

animationTrack = Humanoid:LoadAnimation(animation) --Load the animation somepoint in your code...

if animationTrack then --If the animation is loaded then..
	--do thing
end

Sorry if this didn't work!

This discussion is preserved as it was. New answers, comments, and votes are closed.