PlayerRemoving is not always working, need a failsafe?

Im trying to create a fail safe because sometime the PlayerRemoving does not seem to complete lately and this causes the base not to reset. I also have implemented Bindtoclose but still happens. It seems like 1 out of 10 times the PlayerRemoving fails, and only as of lately (Roblox issue?)

My thought was to create a fail safe by checking to see if the player still exists in workspace or in players folder, and if not then take action.

I have a Owner.Value which is the players name that I can compare the player name with.

Question is what would be the best approach for this?

Thinking of using a game.Workspace:findfirstchild(owner) variable and compare that to the Owner.Value in a loop? Any suggestions would be welcomed and appreciated!

3 Likes

What do you mean PlayerRemoving is not always working? If this is case then this should be reported as a bug, otherwise there’s something wrong with your code.

1 Like

I agree… very strange that it happens at random. If it continues I will report it.

1 Like

CollectionService. Tag the player and use GetInstanceRemovedSignal to check when an instance is removed from your given tag. Check if the untagged instance is a player and if there’s a base associated with it: if yes, reset it.

This sounds more like a problem with your implementation though than PlayerRemoving not working. There have been no reported issues about PlayerRemoving not working and in the instance that they are, (nearly) all cases were due to the code being used.

Without seeing your code, it’s fairly difficult to determine what the real issue is here.

8 Likes

@colbert2677 I will look into that… thank you! It very well may be that something got messed up in one of my recent updates.

I only need the player untagged when they quit. Right now, it also untaggs if they die or reset, is there a way to prevent this so the RemovedSignal does not call unless player quits?

Try tagging the actual player object rather than Player.Character

1 Like

@DatabaseReplace - thank you kindly… worked like a charm.

1 Like

Sorry for reviving an old thread RIP
From my testing it’d appear that PlayerRemoving can be inconsistent in studio but is generally safe in game.

6 Likes