Need help deciding if playing animations on client or server is the way to go and securing keyframe events

Ive heard that i should play aniamtions for players on the client rather than the server, and for some animations thats fine, but ive encountered a problem.

UIS.InputBegan:Connect(function(input, gpe)
	if gpe then return end
	if input.UserInputType == Enum.UserInputType.MouseButton1 or input.KeyCode == Enum.KeyCode.ButtonB then
		held = true
		while held do
			--if char.Humanoid.Health <= 0 then warn("dead") return end
			--if char:GetAttribute("Sprinting") then warn("doin something") return end
			--if char:GetAttribute("Attacking") then return end
			--if char:GetAttribute("Blocking") then return end
			--if char:GetAttribute("Stunned") then warn("doin something") return end
			--if char:GetAttribute("Stunned") then return end
			--if char:FindFirstChildOfClass("Tool") then return end
			CombatEvent:FireServer()
			game:GetService("RunService").Heartbeat:Wait()
		end
	
	
	end
	
end)

this script is supposed to fire events for basic attacks while holding down the left mouse button, and the cooldown and animation is on the server. is it really better to play the animation on the client and find a way to make this work intead of playing them on the server? if so, i need a little help.
another problem is abilities with keyframe events, and i get that i could just fire a separate remotewhen the keyframe event is reahed, but how would i secure that?
my final question: is it really that bad for the server and laggy players to play animations on the server?

2 Likes

bump, i really need some answers, at least if someone can tell me if i should stick to playing the animations on the server

2 Likes