More hitboxes spawn every time the player attacks

I am trying to create a fist weapon

Just as the title says. As the player continues to attack more and more hitboxes spawn :sob:

this is a picture of the code spawning the hitbox, it is a server side script

This is a picture of the client side script that triggers the server side script when the player presses m1

a video of the hitboxes continuing to spawn just in case it is needed to understand what is happening

I havent tried much so far so any help is appreciated

3 Likes

I don’t see anything wrong with this video?

2 Likes

its very low quality so maybe thats why but by the end of it like 10 things are spawned when i press m1

2 Likes

Maybe you need to use the function :GetBoundsInbox(), I’ve never done fighting games, but I think you need check objects every time using the Humanoid.Running event and then disable it after 6 seconds (Use :Disconnect() )

2 Likes

Also, do it all on the client, with all the checks (raycast, distance, etc.), and if something fits, fire the remote event

2 Likes

moving it to the client didnt fix the issue, ill see about the other stuff youve suggested thanks anyways

2 Likes

Oh, I’m stupid, you don’t need to do this on the client

2 Likes

maybe because I’m inexperienced but I’m not sure if humanoid.running and :getboundingbox() are relevant to my script :sob::broken_heart:

2 Likes

You don’t disconnect your events, you create them each time you attack. These ones on the client:
image

Either take those out of the activate function, or disconnect them after they’re done.

3 Likes

thank you so much, didnt even know that was a thing i had to look out for :sob:

3 Likes

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.