CustomAnimation
Key RequiredUniversal

CustomAnimation

Universal Scriptzxrealmzxrealm 875 views 15 executesUpdated Sep 5, 2025
Unrated
00
Lua Script•77 lines (2111 chars)
local customAnimations = {
	idle = "rbxassetid://109588861949567",
	walk = "rbxassetid://73166283667706",
	run  = "rbxassetid://90262411810193",
	jump = "rbxassetid://123018049917489",
	fall = "rbxassetid://86262606787923",
	climb = "rbxassetid://100220637962728"
}

local Players = game:GetService("Players")

local function safeRun(fn)
	local ok, err = pcall(fn)
	if not ok then warn(err) end
end

local function setupCustomAnimations(character)
	safeRun(function()
		local humanoid = character:WaitForChild("Humanoid", 5)
		if not humanoid then return end

		local animator = humanoid:FindFirstChildOfClass("Animator") or Instance.new("Animator", humanoid)
		local animateScript = character:FindFirstChild("Animate")
		if animateScript then animateScript:Destroy() end

		local animations = {}
		for name, id in pairs(customAnimations) do
			local anim = Instance.new("Animation")
			anim.Name = name
			anim.AnimationId = id
			animations[name] = animator:LoadAnimation(anim)
		end

		local currentTrack = nil
		local function playAnimation(name, looped)
			if currentTrack then currentTrack:Stop() end
			currentTrack = animations[name]
			if currentTrack then
				currentTrack.Looped = looped
				currentTrack:Play()
			end
		end

		humanoid.StateChanged:Connect(function(_, newState)
			if newState == Enum.HumanoidStateType.Freefall then
				playAnimation("fall", true)
			elseif newState == Enum.HumanoidStateType.Jumping then
				playAnimation("jump", false)
			elseif newState == Enum.HumanoidStateType.Climbing then
				playAnimation("climb", true)
			end
		end)

		humanoid.Running:Connect(function(speed)
			if speed > 10 then
				playAnimation("run", true)
			elseif speed > 0.1 then
				playAnimation("walk", true)
			else
				playAnimation("idle", true)
			end
		end)

		playAnimation("idle", true)
	end)
end

for _, player in ipairs(Players:GetPlayers()) do
	if player.Character then
		setupCustomAnimations(player.Character)
	end
	player.CharacterAdded:Connect(setupCustomAnimations)
end

Players.PlayerAdded:Connect(function(player)
	player.CharacterAdded:Connect(setupCustomAnimations)
end)

Features & Information

--Change the anims Need change animID to use!

Community Comments (1)

zxrealmzxrealmSep 5, 2025

You need change animation ID to use.

More Scripts for Universal Scripts