Making Player-Specific Custom Animations

I want to make a system where the owner (me) would have unique animations (walking, idle, etc.) While keeping other players as the default animations.

I have used a traditional avatar animator script which was taken from the player model, and changed the idle and walk animation to the new ones. However, I want it to be owner-exclusive (like having a username be plugged in in order for the animations to be accessible, while keeping players with the default.)

Please note that all I want to do is have the animation be only for a certain player and not anyone who joins in. I just want to know how I could apply that to the script I already have.

I also was unable to find anything about this anywhere else, so I decided to put it out there myself.

can’t you just overwrite the animation ids from a seperate local script?

I don’t understand, could you please elaborate further?

inside your animate script you have int values which point to animation ids, do they not?

so from a seperate script, just check if you are the owner, and if so, change that value

Make a LocalScript that checks if you are the game creator, and if you are, it changes your default animations.
It would probably look something like this:

local Players = game:GetService("Players")
local LocalPlayer = Players.LocalPlayer

local function GiveOwnerAnimations()
	local character = LocalPlayer.Character or LocalPlayer.CharacterAdded:Wait()
	-- If character exists, set the variable to it. If not, then wait for it to exist, then set it.
	local animate = character:WaitForChild("Animate")
	-- Waits for the character's animate
	animate:WaitForChild("walk"):WaitForChild("WalkAnim").AnimationId = "rbxassetid://0"
	-- Use your animationId here, and change any animation you'd like.
end

if LocalPlayer.UserId == game.CreatorId then
	-- If the local player is the game's creator, run the function to give them the animations.
	GiveOwnerAnimations()
end

You should place it in StarterCharacterScripts, because it has to give the player the animations every time a new character is created.

1 Like

Thanks, mate! This helped a lot.

No problem. Let me know if you have any questions. Happy to help.

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.