How do I script an Age Limit System?

How do I script an age limit system in my Roblox game so I can keep bots/exploiters out of my game? I’m asking because I don’t want any bots or exploiters in my game.

1 Like
local MIN_ACCOUNT_AGE = 2 --/2 days or more to play the game

game.Players.PlayerAdded:Connect(function(player)
if player.AccountAge < MIN_ACCOUNT_AGE then
player:Kick("Your account needs to be at least "..MIN_ACCOUNT_AGE.." days old to play")
end)

I wouldn’t really recommend going this route though.

11 Likes

We cannot spoon-feed you scripts. Show us what you created first, and then we fix it up.

3 Likes

But I really dont know how to script an age limit system…

Than you so much man! :smiley:

2 Likes

If you don’t you could ask us the method to do it, not write the whole script. :slight_smile:

1 Like

He literally just asked “How do I script an age limit system”, not for anyone to write him one. Someone just replied with a completed script because they wanted to.

4 Likes

Oh well,the fact that it was ‘how can I’ instead of asking for the method would make people think he or she wants the script, not the method

Did I do something wrong? :pensive: Sorry if I did so! :frowning:

But I didnt ask him to write the whole script

But I didn’t actually ask for the script… I just asked how I can make one :grimacing:

No, it’s alright. Sometimes we are unaware about a rule on the forum. :slight_smile:

My post was just feedback for next time, so you know how to ask for scripting support. :slight_smile:

Yay, thank you so much! :smiley:

Since I am actually a builder, and I cant script and no one is my partner, I asked this so I could make an age limit system.

Got this error when trying the script Expected identifier when parsing expression, got ')'
The code should work now.

local AccountAgeLimit = 5

game.Players.PlayerAdded:Connect(function(player)
    if player.AccountAge < AccountAgeLimit then
	    player:Kick("Your account needs to be at least "..AccountAgeLimit.." days old to play")
    end
    end)
3 Likes

Alright, thanks man I really appreciate it! Thanks.

2 Likes