Hi!

I'm experiencing a problem with my sword's animations.

Here's the localscript:

local Tool = script.Parent;
local click = tick()


Tool.Equipped:connect(function(mouse)
	mouse.Button1Down:connect(function()
			
		if tick() - click < 0.8 then
		local anim = Instance.new("StringValue")
		anim.Name = "toolanim"
		anim.Value = "Lunge"
		anim.Parent = Tool 
		else
			local anim2 = Instance.new("StringValue")
		anim2.Name = "toolanim"
		anim2.Value = "Lunge"
		anim2.Parent = Tool 
		end
	end)
	
	

I'm trying to make it lunge when the player double clicks it and slash when the player clicks one time but no animations happen :(

1 comment

0

you have to make a new animation, set the animation.id to the correct animation id and then load it into the player humaniod. ( https://developer.roblox.com/api-reference/function/Humanoid/LoadAnimation ) Call :Play() on the item returned by Humaniod:LoadAnimation()