Kick player if they switch windows

Hey! I am making a quiz for my cafe and if you finish then you get trainee rank in my group. I am trying to make a script that kicks the player upon switching to another window (aka an exploit to hack the game for them to get a free rank or google to lookup answers.) I can not find much about this, but have seen games do this. In trade hangout, if you switch the window it shows AFK above your head. I wan’t to kick the player to prevent exploiting.

1 Like

I don’t believe this is possible. I don’t think trade hangout does that, maybe it marks a player as AFK if they’re idle for a long time, not necessarily the way you say it does.

Just implement a timer system, like “answer in 6 seconds” or something. You will never be able to prevent exploiting. The timer system would help with legit users who try to use Google.

1 Like

Use this:

then kick the player if the event is fired.

5 Likes

I’d be wary of using client-side methods like these; an exploiter can easily work around them. You should instead look at using a timer in a server script as @incapaxx suggested if you want a robust system that can’t be worked around using exploits.

4 Likes

Thanks. I am thinking of using a combination of both. Also, I am keeping it so that you only get trainee, so that way we interview you and can determine if your a good worked :slight_smile: I just wanted a slight protection to stop most exploiters.