I need a script that kickes AFK players after a choosen time.
This isn't a request site, but I can certainly show you what you need to do!
(Note: Do not use a localscript, because you cannot kick a player with one)
What you can do is make a script and in it use an event with the player called Idled.
In essence this fires after two minutes of the player being "idle". Normally ROBLOX will automatically kick any player who is idle in game for 20 minutes. After two minutes, the event will be fired (sort of updating if you will) until the player is no longer idle, or after 20 minutes is kicked.
Of course you need to get the player before doing this, so what I personally would do is use the PlayerAdded event.
With simple knowledge of coding, you can implement this perfectly into your code to make it work just as you want!
Here is the example code on the wiki page, i'll try to break it down for you:
game.Players.Player.Idled:connect(function(time) -- This is the function, of course you have to define "Player", but that can easily be done by using the PlayerAdded function. time is simply how long the player has been idle print("Player has been idle for " .. time .. " seconds") -- If the player had been idle for 300 seconds, this would print in the output "Player has been idle for 300 seconds". You could use an if statement, to check when the time is at the point when you want to kick. end)
I hope this helps! Here's some more wiki links to anything you may need to know (In case you are extremely new to coding)