Why my combat system is hitting the current player?

It’s difficult to help you if we don’t know how your structure of the game is laid out.

Is it a server script?
Is there a local script inside of a tool that fires a remote event to the server script?

Also, what they were saying is if whatever your tool is hits a part, it should check what the parent of that part is, if the parent of that part is equal to the player that was swinging it, it should return end, which basically means it just prevents it from damaging the player, you would then add an else statement that would contain the code to damage the actual enemy(or thing you want to damage)

To tell the script who the player is (who we don’t want to hit) you simply need to send the player through the remote event that is firing as an argument to the server script. which I assume we have a local script in the tool that does that but again it’s difficult to tell what we are working with here.

Also, when we are sending you links(documentation) to what you don’t understand, for example, GetPartsinPart, it’s there so you can read about it to understand it, you could also go to youtube and attempt to find a tutorial on what we sent you documentation on instead, and follow the tutorial to try to better understand that
Then apply what you learnt from the documentation or tutorial to your current code. :slight_smile:

1 Like

You can try using a spatial query hitbox module like muchacho hitbox (https://create.roblox.com/store/asset/9645263113/MuchachoHitbox)— and there is a video on youtube if you want a tutorial. It casts the hitbox on a serverscript aswell, which may be helpful to u even if you dont use the module

3 Likes

@Polynovuh, @Phoenix_Ascended, Thanks for the help! I appreciate your two helps, i’m gonna try the @Polynovuh one. But thanks anyway guys!

2 Likes

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