Hey I learned about ChildRemoved and wanted to try it out to see if I can check if a Player deletes a script
local Character = LocalPlayer.Character or LocalPlayer.CharacterAdded:Wait()
Character.ChildRemoved:connect(function(Object)
print(Object.Name .. " removed from the Workspace")
end)
But when ever I test and delete the LocalScript in StarterCaracther scripts, nothing happens
This is my first question ever posted on devforum please let me now if I did something wrong, Thanks!
So say I was a Hacker, (I know it isnt the best to prevent exploits on the Client) and I got into the Explorer, etc in the game and I deleted the script on StarterCarctherScripts would this cause any affect?
StarterCharacterScripts are cloned to the player once they load in. Hackers are not able to remove scripts that are cloned to other players, so they couldn’t prevent other players from having the script cloned. As @sjr04 said, to test it, you should remove the script from the actual Character instead of StarterCharacterScripts. As far as anti-exploits go, attempting to prevent exploits on the client is utterly useless, as exploiters can just remove the scripts that are trying to stop them. You are much better off creating checks on the server. As for your code, connect is deprecated, use Connect instead.
Yep! That’s what you’ll want to do to test this. StarterCharacterScripts is just the folder that stores these scripts in the explorer, when the game is run and players are added, it clones these scripts inside the Character.
Don’t delete the actual script that is attempting to check if other scripts are deleted. Test it with an empty script. It can’t detect if itself is deleted.
I’m trying to check if the actual Local Script is being deleted, Is there something that I could call that will prevent the script from being deleted and still print the message?