Universal Script 📌
887 Views
19 Executions

CustomAnimation

Universal Script 📌
zxrealm
zxrealmPublished 10
1 year ago
Get an executor
Please login to perform these actions:

Does it work?

No reports yet

No reports yet. Tried it? Be the first to say.

Also noticed:

Description

--Change the anims Need change animID to use!

View Raw
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()


Comments

1
Log in to join the conversation. Login
zxrealm's profile picture
zxrealmUploader1 year ago

You need change animation ID to use.

1

More universal scripts

See all
Universal Script 📌
54
3
Approved 32 minutes ago
Key System
Universal Script 📌
9.8k
60.7k
Bumped 47 minutes ago
Key System
Universal Script 📌
3.9k
10.4k
Bumped 48 minutes ago
Script hub
272.7k
884.6k
Bumped 1 hour ago
Key System

Script hub

#16 this week

Verified script badgeAxon Hub 60+ Games & 800+ Features