Account age is how old your account is, in days.
Account age can be used for many things! For example, this game uses Account Age as a leaderboard to rank the oldest players in the server!
Who would've thought of this? There are literally infinite possobilities. The limits are only your imagination 😊
But for this tutorial, I am going to show you how to use Account Age to stop bots from entering your game.
To put it short and simply, bots are software applications that run repetative autoamted tasks much faster than a human could. Do you know what this means?
Create an account
Join your game
Do nothing, or hardly anything.
What is the issue with this?
Most games on Roblox are multiplayer games and are designed to be played with others to have a shared experience together. So when potentially 80% of your server players are bots, the real players can have a poor gaming experience and downvote your game, never to return again.
Some developers bot their own games for their own good to give an appearance that their game is popular and may entice others to try it out as well. These bots can also get their page to the frontpage solely from their bots playing their game and upvoting their own game. But this can also backfire as stated in the paragraph above.
So, how do we stop them?
1. insert a Script into ServerScriptService. Give it a name like "BotKicker".
2. Create a variable to be the minimum account age (in days) to allow into your game. We will do 3 days to be safe.
local minimumAge = 3
3. Create a PlayerAdded event. This will trigger whenever a player enters your game.
4. Check if the player's account age is less than the minimum account age.
game.Players.PlayerAdded:Connect(function(player) if player.AccountAge < minimumAge then end end)
5. Finally, kick the player with the appropriate kick message. Although a bot won't read this, the account could belong to a human-being and would like to know why they were kicked. I am going to create a kickMessage variable so that we only have to concatenate the string once and reference it from there.
local minimumAge = 3 local kickMessage = "Your account must be at least "..minimumAge.." days old to play this game." game.Players.PlayerAdded:Connect(function(player) if player.AccountAge < minimumAge then player:Kick(kickMessage) end end)
And when a newly created account enters your game (bot or real player) they will see this.
This is a completely isolated script from the rest of your game. Learn from this script and insert it into your own game and say bye-bye to bots.
I hope you enjoyed reading this, as I've enjoyed creating it. Have a good rest of your day! 👋