Game.OnExit callback for when player closes window

If a single dialog popup displays in a game that shadily tries to keep you playing, and it was implemented properly where you can just click ‘NO’ and leave the game & a dislike and hopefully never play the game again, that would be YOUR choice entirely to keep playing that shady game.

I can only see one case where this would be negative, while there are uncountable cases where it would be useful.

Also I can’t remember a time when I was on one of those shady websites that wouldn’t let me leave, where I actually RETURNED to that website to use it again. If people are going to abuse this feature to annoy people, then all it will end up doing in the end is making users HATE their game and NEVER want to play it again. That is the designer’s BAD choice, and it should be up to the user to decide if they want to keep playing.

The problem is, I can’t think of a single situation where I (and apparently also other people) would say it’s good game design that would help improve user experience.

If you need to make something clear to the player you could do a message at the start of the round instead (“Stay all the way til the end of the round to earn a bonus!”), and if it is actually involved with game logic (as in “Don’t leave, you’ll lose data!!!”) then there’s something wrong with how you store/save data.

How about where you want something to prevent people from leaving Official/Ranked matches; telling them that if they leave they won’t be able to do another Official/Ranked match for 30 minutes or so.

CS:GO will BAN you from matchmaking if you leave in the middle of matches too often.
Just because you can’t think of a use for it doesn’t mean others won’t.

You can still do this using a message shown at the beginning of the game?

Think about this: ROBLOX already has a confirmation dialog when you exit the game through the Esc menu, and they didn’t hook that window up with an Alt+F4 intercept or when you click the close button on the window. They could have easily made it work that way, but they did not.

99% of users normally ignore any starting messages but will read a message or dialog that pops up because of one of their actions. Also I know a ton of things ROBLOX could have ‘easily’ made work but they didn’t.
That doesn’t mean we shouldn’t have a beneficial feature.

Tons of competitive games that are at the top of the market and industry utilize this feature in more than one way. I’m not going to accept any more ‘bad design’ excuses, If you can’t provide any legitimate reasons as to why this couldn’t work please don’t comment.

1 Like

I don’t really have an opinion on the OP’s feature request, but I’m pretty sure there’s a confirmation dialogue on the escape menu leave button because you can accidentally select it. You might accidentally press “L” or have your mouse slip when you’re trying to click the rest/resume buttons, whereas Alt+F4 is pretty difficult to accidentally press and you’ll rarely be clicking anything in the vicinity of the X button to have the chance to accidentally click it.

1 Like

Abusive users can use to help teleport people around their games for tix, by not allowing the user to leave, they are now stuck teleporting between places

This is where I have to reiterate, this feature needs to be implemented PROPERLY.
If a user has this dialog open, teleports should be disabled. If a user is teleporting, using this dialog should at least yield the teleport until the user has chosen what to do.
I haven’t seen one decent rebut towards this, as long as the feature is implemented properly.

1 Like

I can see games trapping in players with pop-up guis


this is the default roblox confirmation popup when we choose to “Leave” from the roblox menu.
if roblox allow us to display a message between the title “Are you sure …” and the buttons, then it should be suffice to satisfy the OP example user case: display the "Warning: if you leave you will lose your match bonus!’


this is the default popup when the player alt-F4 or close window button on PC. it might not need this customizable message to show

4 Likes

+1

This would be particularly useful to warn players when leaving might break something, similar to how closing a tab with unsaved changes gives you a warning in your browser. For instance, if Roblox’s servers are down and data is not saving correctly, a small message could warn the player that their data hasn’t yet saved and leaving could result in data loss.

When games couldn’t properly save players’ session data during the October 2021 outage, it would’ve been of some use to know that leaving would result in losing a bunch of data (though staying on wouldn’t have done much anyway).

If players want to leave your game, that doesn’t mean at all the game is bad. But for example the game has a long parcour course with a big reward at the end, but if you leave, you lose your progress! What better way would be there than a warning message when you want to leave the game. Overall I agree that it is a good feature, but it is not the most important feature that roblox is in need of.