So I have this NPC that gets cloned when a player kills it. And after getting cloned everything works as normal such as NPC animation, NPC losing health when players are attacking, NPC following the nearest player, etc except it is not dealing damage to the player like it was doing before it got killed the first time and got cloned, which(The damage system) is determined by this following script located in serverscriptserviece
------------Solved------------ Content Removed for the safety of the game-------------
Could you maybe send the script that is cloning the NPC? Also, you shouldn’t use hum:LoadAnimation() every time you run the attack loop. Define the animation outside of the loop, then play the animation inside of the loop.
1 Like
Thanks, I have added more information to the post.
Is that last screenshot where the script breaks? Because if it is, it’s possible it isn’t the NPC breaking, it’s something to do with the boss. Try adding some extra prints in places and checking the boss’s children after the script breaks.
I mean that NPC I am talking about is the Boss. And the script is breaking here on line 28

Well, it breaks there because that’s when you call the function. The function is the thing that’s breaking. Also, where is the broken script running?
1 Like
Ok ok I changed the location of the script from serverscriptserviece to inside that npc > changed it’s local and sets it to the parent and is working now.
Question: Will there be chances of players getting god mode by exploiting the script because of it is not being inside the serverscriptserviece?
Server scripts A.K.A normal scripts are very hard to exploit, no matter the location. So no, there isn’t a chance that a player can exploit the script.
1 Like
I see, I am new to this Roblox Studio things so I wasn’t fully aware.