How do I make a moon animation play?

How do I play the animation in a script made by Moon Animator? this is my script and explorer.

image

local player = game.Players.LocalPlayer
local character = player.Character or player.CharacterAdded:Wait()
local debounce = false
local onetwo = true
local sword = script.Parent
local oneanim = script.SwordSwing1
local twoanim = script.SwordSwing2

sword.Activated:Connect(function()
	if debounce == false then
		if onetwo == true then 
			oneanim:Play()
			onetwo = false
		else
			twoanim:Play()
			onetwo = true
		end
	end 
end)```
1 Like

anyone? please i don’t want to let this go to waste

Okay, pretty simple what you have to do here:

just right click SwordSwing1 and click “Save To Roblox”

when it shows you the id, click the copy button should look something like this
image_2022-07-26_165441754

next you would have to create a couple variables and script a bit

local Animatior = character.Humanoid.Animator
local oneanim = instance.new("Animation", script)
oneanim.AnimationId = "rbxassetid://".. -- id you copied goes here
oneanim = Animator:LoadAnimation(oneanim) 

-- then run oneanim:Play() and it should play the animation

there we go, just do the second code example again for adding another animation.


The sword is legit on the ground

Never mind, the part wasn’t named handle. But it says now that whenever I play an animation its nil
image

Hi, sorry for the spam but FINALLY after a bit of debugging it works, thanks a ton

1 Like