Hey there! As we ROBLOX Players know: There are Bots. MANY Bots. So I wanted to deliver the best experience to my Server Players and made a BotKicker in ServerScriptService as a Script. Now when I attempt to play the Game inside of ROBLOX Studio it says following:
ServerScriptService.BotKicker:5: attempt to index nil with "AccountAge"
Now I went trough the script and couldn't find a reason for this to happen. The script:
local minimumAge = 15
local kickMessage = "Sorry, but your Account must be atleast 15 days old to join this game. Please use an account that is over 15 days old and try again."
game.Players.PlayerAdded:Connect(function()
if player.AccountAge < minimumAge then
player:Kick(kickMessage)
end
end)
I hope somebody can help me with this :/ Have a nice day!

2 comments
on line 4 player is nil, you should do game.Players.PlayerAdded:Connect(function(player)
Okay, Thank you so much! :D