CodeReview | Account-Age-Checker

Hello, I know this is a small block of code, but I wanted to know if this is a good way of kicking accounts that are not a week old, really just checking if I should use return later on there will datastore stuff under this.

local Players = game:GetService("Players")

Players.PlayerAdded:Connect(function(Player)
	if Player.AccountAge <= 7 then
		Player:Kick('Account must be a week or older!')
		return
	end
end)```

Not totally sure what the point of the return there is? Your not returning anything back like a function does or anything so what would the point be?

Ah yeah, I was returning because I have other kick functions below this that sometimes fire, covering up the original kick message.

There’s nothing inherently wrong about this, though I prefer that function arguments use camelCase for style reasons. It’s up to you though.

Just do keep in mind that you also kick people with accounts that are a week old because you use <= and not just <.

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.