Disconnect Player on Removal from DataModel

Calling :Remove() or :Destroy() on the player (in dev console) result in various kick messages. That is cool, but will it happen after the update?

Glad it’s on my birthday too!

1 Like

Please just destroy the Player. When examined in context, it’s wholly nonsensical that Players and their characters are still not being properly cleaned up. :Destroy() has been the standard for destructing instances for roughly a decade now. Very few scripts rely on the Player instance’s connections to persist after the player has disconnected. Many scripts have memory leaks, because their creators assume that these instances will be destroyed.

The decision here should be clear. Roll the update out as a beta to give developers ample time to check over their code, and then push the change. If there are systems on Roblox’s end standing in the way of this, they should gradually be updated in preparation of meeting this goal.

19 Likes

Does player get kicked if the current player model from Workspace is removed?

While good, this change is a bit of a bummer for me, as my favorite game I’ve made relied on exploiting this oversight in a couple of ways to confuse the player and add to its strangeness, with things like completely deleting the CoreGui menus or preventing the game from appearing on your “Last Played” page.

Then again, these behaviors could very well be used maliciously, so props to you I suppose.

2 Likes

This is desperately needed, so I wish you luck in finding a speedy solution! :slight_smile:

Ah okay, yeah this lead way to a lot of critical bugs, good to see it being cleaned up.

Not to devalue the issue, but I think it’s worth noting that these connections only linger if a circular reference is formed with the instance that the signal connection belongs to.

As such, the code pattern you mentioned should only leak if the Player, or some object which strongly references the Player, is accessed from within the function connected to .CharacterAdded.

-- Irreproachable, as far as memory leakage dictates concern
Players.PlayerAdded:Connect(function(Player)
	local PlayerName = Player.DisplayName
	Player.CharacterAdded:Connect(function(Character)
		print(PlayerName.."'s character has spawned!")
	end)
end)

-- Causal of memory leak, as closure references Player
Players.PlayerAdded:Connect(function(Player)
	Player.CharacterAdded:Connect(function(Character)
		print(Player.DisplayName.."'s character has spawned!")
	end)
end)
3 Likes

No, and this will not be changing.

You can safely reparent (including to nil) or destroy a character model (it may - however - cause issues with the control scripts). If you destroy a character model, it will not be recreated until LoadCharacter is called.

1 Like

Add a opt-in mode, just so people dont complain about this lmao

Update is good, but add previous behavior back and make it toggla-able feature

1 Like

This is a good change. Players should be kicked when their player object is destroyed. Otherwise, their character would be destroyed and they would be stuck watching everybody else. This was a bug, so it was going to be fixed eventually.

1 Like

I really don’t understand what this is about

1 Like

It is a change that will Disconnect Player on Removal from DataModel.

1 Like

But its not really needed nor worth making a toggle

2 Likes

please oh please make this off by default i’m so begging you

1 Like

How does this affect you? I would love to know, as it is a simple bug fix being done here.

4 Likes

I really think ROBLOX should release the Byfron Software (Anti-Virus) as soon as possible, Since it’s getting our of control.

So, would “disconnect” mean your client would close, or you’d receive a disconnection message as one usually does when they’re kicked from a game?

The effects im going to mention definitely shouldn’t be allowed though I thought I should mention that there qute a few weird behaviours you can cause by abusing this glitch with different code variation, such as deleting CoreGui, having the game pretend that you dont exist (I also believe this extends to the website), etc.

Now Script builder games have to bypass this. Alot of so called “SS Scripts” on SB type games are using the advantage of destroying player and using chat to say mean words or innapropiate stuff, roblox can’t track logs since there is no such player on the server, or ussually abuse powers and ban others this also works on client executors such as synapse to bypass and destroy player though it doesn’t work sometimes and do nasty stuff. I honestly think this is the best minor update.

-- L take, deleting ur player object literally breaks games this doesn’t make any sense.
image

-- and if ur only deleting the player object on other people’s clients and not the server or your own then this change won’t even affect u in the first place, do you think they’d just give clients the authority to kick other players??

5 Likes