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

Animation is not being played?

I believe the problem is that it's overwritten, but idk how I'd fix that. This is the script in ServerScriptService (no output):

local Monster = script["Lord Umberhallow"]

game.Players.PlayerAdded:connect(function(Player)
	Player.CharacterAdded:connect(function(Char)
		repeat wait() until game.ContentProvider.RequestQueueSize == 0
		for _, v in pairs(Char:GetChildren()) do
			if v:IsA("Hat") then
				v:Destroy()
			elseif v:IsA("CharacterMesh") then
				v:Destroy()
			end
		end
		
		for _, v in pairs(Monster:GetChildren()) do
			if v:IsA("CharacterMesh") then
				v:Clone().Parent = Char
			elseif v:IsA("Hat") then
				v:Clone().Parent = Char
			end
		end
		
		local Mouse = Player:GetMouse()
		local function CreateAnimation(ID)
			local NewAnim = Instance.new("Animation")
			NewAnim.AnimationId = ID
			return NewAnim
		end
		
		local Animations = {
			Swipe = {
				CreateAnimation(278621260)
			}
		}
		Mouse.Button1Down:connect(function()
			Char.Humanoid:LoadAnimation(Animations.Swipe[math.random(1,#Animations.Swipe)])
		end)
	end)
end)

1 answer

I'm assuming you want the player to spawn WITH the walk/idle/jump/fall animation (Whichever animation this is) So I'll give you a script that does just that.

wait(2) -- You can remove this if you'd like.
game.Players.PlayerAdded:connect(function(player)
	while not player.Character do wait() end
	local character = player.Character
	local animateScript = character.Animate
	animateScript.fall.FallAnim.AnimationId = 'http://www.roblox.com/asset/?id=278621260'
end)

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