My script won’t work

--game.Players.PlayerAdd:Connect(function(Player)
    local Allowed = 14
    if Player.AccountAge <= Allowed then
        Player:Kickk("Account must be atleast "..Allowed.." days old. Please try again in "..(Allowed - Player.AccountAge).." Days")
    end
end

You added an extra K. Please remember to do checking.

I tried and it didn’t work oof.

I couldn’t figure out the answer but it is better to change the days to years

edit -

Maybe read this

1 Like

Try publish this game, and make an account and use that account to join the game. See if it works or not.

you have the function as a note. Remove the --.

1 Like
wait(5)

local Allowed = 100000 --type in how many days old their account should be.


for i,v in pairs(game.Players:GetPlayers()) do
		if v.AccountAge < Allowed then
			v:Kick("You must be at least "..Allowed.." days old to play this game, please try again in" .. Allowed - v.AccountAge.." days")
		end
	end

This should work, just change the allowed variable to how many days you want the players to be, if you need any more help I’ll be happy to see what I can do.

game.Players.PlayerAdded:Connect(function(Player)
    local Allowed = 14
    if Player.AccountAge <= Allowed then
        Player:Kickk("Account must be atleast "..Allowed.." days old. Please try again in "..(Allowed - Player.AccountAge).." Days")
    end
end

Another misspelling found, change PlayerAdd to PlayerAdded

1 Like