The script is in the tool, the tool cant detect that, Because the tool is created a bit after the player joins.
This wouldnt work if there were multiple players with the same tool, and to detect if its the right player would need the same code thats used in my original script.
because i assummed you wanted the script to work if it was a Child of the Character Model then it could’ve worked when player leaves and you use GetPlayerFromCharacter i didn’t test
you should be using Player leave and PlayerAdded on the server scipt service you should never use this multiple times it is bad practice and can cause Clashing between scripts. you should only need to use it once
server script service has nothing to do with this tool.
I guess i might have explained this wrong?
There is a tool, Which has a server script in it, Which has a hitbox system, and detects when the tool, character, or player is destroyed/leaves
My problem, is that the hitbox is only removed when the character is deleted, if the player leaves first, while the character is fine, The hitbox will stay.
Server Script service is used so the Server can handle things. Player Leaving is one of those things so the server script service has everything to do with this
The server script service does not have anything to do with this.
Yes, I know this, Im not that new of a developer.
Player leaving can be detected yes, But the server script is inside the tool, Not server script service. What is SSS Supposed to do with this script?
the hitbox is not a real part, the only way to get rid of it (its a spatial query) is by calling “Stop” from the module on the variable.
It has to be done this way, so im not sure what you mean.
oh my bad i thought the hitbox was an actual part. Ok so the Server scripts All scripts ClassName “Script” are all interConnected . Solution would be to fire a bindable from the Tool Script to the SSS for that to create the Hitbox and then do the player leave from there