My question is whether Roblox PlayerAdded and PlayerRemoving handle these, imagine the player left and joined so quickly that the old instance didn’t get deleted yet, would they co-exist or is it checked by both events?
No, there is no way for there to be multiple instances of the same player. With no exceptions, the player is deleted upon leaving.
Did you read my topic correctly? The playerinstance will get deleted regardless, but what if there’s a race condition between them?
Sorry, but there is no “Imagine” here, it is literally impossible for there to be two instances of the same player. And yes, I did read the topic correctly. I read the title, responded to that, and since my answer said that they couldn’t coexist, it answered both the topic and the title at the same time.
Adding onto this, there is no way due to the differences of the UserID and everyone having a different one. Each player cannot have the same username, there may be some rare occurrences but none the less, no one has the same.
What you’re saying is impossible. The way someone could join the same server, don’t get their player object deleted, and bypass the same account launched on different device error is beyond me.
I am talking about the same player, nothing to do with UserIDs, usernames or anything here
Yet again it doesn’t look like people in this thread have read my original question
For context I want to provide as an example, SetAsync and GetAsync, and the reason why UpdateAsync exists being to prevent a race condition between the two.
This is what I want to know, if Roblox events (PlayerAdded and PlayerRemoving) already safe-check these things EVEN if it’s “impossible” for it to happen, or do they just “trust” the server’s speed to delete the Players?
I do not want responses based on probability about a thing I already know.
I believe the answer is a No. No matter what as long as a player has left the server then whatever instance they had would have been deleted.
The simple answer is a No, they cannot co exist.
@DAMOLA345 Maybe I didn’t express myself correctly, but I already know it’s impossible for that to happen, just asking if the internal events (PlayerAdded and PlayerRemoving) do check that race condition, if it can be checked / tested.
→ Can two playerinstances of the same player co-exist? - #8 by UltraYummyChocolate
No there cannot be duplicates of the player object. If a player tries to join the game, and a old player object is already present, then it will kick you, telling you that your account is already in the game, on another device/session.
Are you concerned about this due to datastoring?
Well, I haven’t checked it, but since I’m very paranoid I decided to ask the safety of both events in such extremely rare case. It’s just very general, could affect the entire game.
There is no need to be oversecure about the player instance. The Roblox servers makes checks, before they even are allowed in your game.
Off-topic, but I found this problem one day, which, for my game at least, was very game breaking until I implemented JobIds to prevent duplicates, as there’s datastores with its privateServerId that could be messed up.
It’s such a dumb thing yet Roblox can sometimes be quite uncareful. I discovered recently that Players that do not have their character loaded are able to remove things from their PlayerInstance. That’s what makes my paranoia boost, luckily, i never used the playerinstance for any storage
Yes, with datastoring you’ll have to do extra sanity checks yourself.
This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.