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

Im new to animations and my animations aren't playing?

local player = game.Players.LocalPlayer
local mouse = player:GetMouse()
local tool = script.Parent

local function Activated ()
	player.Character.Humanoid:LoadAnimation(tool.Equip)
	player.Character.Humanoid:LoadAnimation(tool.Idle)
	local target = mouse.Target
	if target then
		local remoteevent = target:FindFirstChild("RemoteEvent")
		if remoteevent then
			remoteevent:FireServer()
		end
	end
end

local function Deactivated ()
	player.Character.Humanoid:LoadAnimation(tool.Unequip)
end

tool.Activated:Connect(Activated)
tool.Deactivated:Connect(Deactivated)

There's no errors, all animations are placed in the tool like they should be. How I made my animations: I have a tool and placed the handle of it inside an r15 block rig, and used tool grip (plugin) to align it, then used custom character creator (plugin) to bind the handle to the right hand. after that I made the animations and saved it to roblox. Then I inserted animation (object) to the tool and edited the animationid.

1 answer

✓ Accepted answer

To make animations, you have to insert an animation into the script with the ID as it's value, and reference it in the script like this.

local animation = script.Animation

local AnimationTrack = Humanoid:LoadAnimation(Animation) --- You need to load the animation, so you do this.

AnimationTrack:Play() --- playing the animation.

Also you should just set a variable for humanoid instead of doing Player.Character.Humanoid

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