Cloning enemy from rep storage makes it invincible and unable to take damage

bro dont worry i figured out how to fix the stuff ill edit the first message for you :slight_smile:

1 Like

Running a loop continuously is heavily unnecessary when you can just run the code when the health of the NPC changes, using :GetPropertyChangedSignal.

like this?

scroll up i fixed the formatting on the code for you, sorry i didnt know how to

1 Like

Appreciate it,

Couple questions to help me fix stuff:

  • What classes are the pests? Models? Folders?
  • Do they have any local scripts in them
  • What is the goal of the combat system? Are pests supposed to be visible to only their specific player or to all players?
  • 1
    image
  1. only serverside ones… which might be bad
    image
    should i change the health manager script to be serverside tho?
    1. the goal of them was to spawn on the individual player if their tier value is 4 or higher and grant u some currencies but if other people can kill them before they reach the tier then idk its bad i guess

sorry for the rambling

No worries, thanks for the extra info. I’d Keep the scripts as they are.

Wanting only some of the Pests to be local makes it more complex. You’d want to clone them on the server if public, but only on the client if local.

From there you need your sword to detect enemies and deal damage on the client so it can damage any pests you encounter, local or global. Problem is that method is very insecure from an exploiting standpoint. So you’d also need to have a additional ‘sanity’ checks where the server confirms whether a pest actually died vs whether an exploiter set the health to 0

In otherwords, there’s a lot of conditions that go into what you want, and if you are unable to set that system up yourself, its unlikely you will find someone willing to do that level of work for free.

Best of luck