My moves are extremely buggy and extremely laggy, please help!

I have VERY HUGE PROBLEMS WITH MY SCRIPT.

I am using the RaycastHitbox Module Raycast Hitbox 4.01: For all your melee needs!
as well as the Lightning Beams Module [Effect] v1.1 Lightning Beams: Seamless, smooth and procedurally animated with beam-like properties

  1. So the first problem is, when used in roblox studio, the output is smooth and expected.
    However when used with multiple people in a game, it is VERY LAGGY, and also buggy.

I made changes in my scripts so it works slightly, but it is still extremely laggy, especially the one that smites once it has touched the floor.

  1. The next problem is that the RaycastParams of the RaycastHitbox module does not work! when i’m in-game and I clicked the smite button it damages me as well as others!

It also increases damage every time it has been used, so after the 5th smite it is basically one shot.
https://gyazo.com/903754c78a2cdf4b58e5c41cef3145e0.mp4 (it’s how laggy it is after one smite, you may not see it because i’m in studio but it gives a huge momentary lag spike.)

  1. It is very laggy, I am running all of this through a localscript and used the script to be a damagehandler as well as to fireallclients.

A single smite gives me a HUGE lag spike.

  1. The F move (the one the makes spears rain down) doesn’t work a second time, as shown in this video https://gyazo.com/68dcc951d6d944d0c74f142cc925a5ef.mp4 it doesnt find the nearest person and instead goes somewhere else.

The full scripts:
Serverscript 3/31/2022 3:34PM GMT+8 - Pastebin.com - serverscript
Localscript 3/31/2022 3:34PM GMT+8 - Pastebin.com - localscript

please note that this is extremely messy as i havent scripted for 6 months now.
there is also no errors shown in the output whatsoever, i’m just having the problem with it’s performance as well as the issue with the f move.

MORE INFORMATION (just stuff i pulled out from studio)
https://gyazo.com/d9af6553efceb505d947c1fec2680675.mp4

any help is appreciated, I just got off a break and I am so sorry if you cannot read my messy code

alr nvm this, it’s been fixed
i just had to do this

example:

attack.OnClientEvent:Connect(function(input,spear)
	local Hitbox = RaycastHitboxModule.new(spear:FindFirstChild("Handle"))
	Hitbox.RaycastParams = rparams
    Hitbox.Visualizer = false
			
	Hitbox:HitStart()
	
	local connection
	connection = Hitbox.OnHit:Connect(function(hit,hum)
		attack:FireServer(Enum.KeyCode.E,hit,hum)
		Hitbox:HitStop()
		connection:Disconnect()
	end)
end)

I… just had to disconnect some connections