I am adding some sanity checks to some scripts and feel concerned about using a return statement in this module script.
My fear in adding it is that it may actually send info back to a hacker. So I don’t want to add it if it’s not even needed.
-- make sure it's a player
for i, checkPlayers in pairs(Players:GetPlayers()) do
if recievedCharacter.Name == checkPlayers.Name then
realPlayer = true
else
return -- do nothing
end
end
Why return, and not continue or break? Also, why check the names? You could just use Players:GetPlayerFromCharacter(receivedCharacter). But returning nil, will probably not give the exploiter much, if not any information.
I was just reading about continue. Do you know if I need the return statement or not? It’s the only way I know to stop the script from moving forward. There is a lot more after checking if the receivedCharacter is actually a real player.