Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

How to prevent players from hiding in nil?

Players in my game are hiding their selves in nil to troll or stalk.

game.Players.LocalPlayer:Destroy()

I been trying to prevent this with PlayerRemoving or Changed but this seems to not work. Any help?

4 comments

0

maybe every 30 secs you can loop through all the players and check if their characters are in the workspace and of they arent then you can parent them to the workspace (and keep their position if you want to)

0

Yes, but how would you restore the player back to Players? Or kick them?

0

I don't think you have to worry. The players are only deleting themselves on the client, which means they still exist on the server and for everyone else. So although it may seem like they're in nil, they're not.

0

They are using it though serverscripts with require()

1 answer

I saw this post a while ago and it stuck in the back of my mind as something I may need to address. I'm not sure if this is a solution to your problem or not, but it's at least something.

I found this link today when researching a problem I was having with my saving script: http://devforum.roblox.com/t/psa-connections-can-memory-leak-instances/90082/13

More specifically, on posts 13-15 jewelycat and Quenty discuss how character and player instances get parented to nil. It seems you'll need to sever connections from the character when they die. The link explains it a lot better than I can.

This discussion is preserved as it was. New answers, comments, and votes are closed.