Hi, so I'm trying to script a sword with animations, and it works perfectly fine in studio, even when doing the multiplayer test, but when I enter the actual Roblox client, it won't play the animations, the sword still detects me clicking on the server script (which deals damage), so I know thats working. The local script could't be doing anything for all I know. Heres the code:

In the serverScript:

function OnClick()
	if script.Parent.Attacking.Value == false then
		script.Parent.Attacking.Value = true
		wait(0.75)
		script.Parent.Attacking.Value = false
	end
end
function touch(hit)
	if script.Parent.Hitting.Value == false then
		if script.Parent.Attacking.Value == true then
		
			hit.Parent.EnemyHumanoid.Health = hit.Parent.EnemyHumanoid.Health - 10
			script.Parent.Hitting.Value = true
			wait(0.75)
			script.Parent.Hitting.Value = false
		
		end
	end
	
end
script.Parent.Handle.Touched:Connect(touch)
script.Parent.Activated:Connect(OnClick)

And in the localScript:

print("scriptready")
function Equip()
	
	Anim = script.Parent.Parent.Humanoid:LoadAnimation(script.Parent.Animation)
	print("Anim Loaded")
	
	
end
function onClick()
	print("Checking")
	if script.Parent.Attacking.Value == false then
		print("Click")
		Anim:Play()
		wait(0.75)
		Anim:Stop()
		print("finished")
		
		
	end
	
	
end

script.Parent.Equipped:Connect(Equip)
script.Parent.Activated:Connect(onClick)

Any help wpuld be usefull, thanks.

3 comments

0

would* be helpful

0

Try usinging pcalls to see what went wrong

0

Lol I figured it out sorry