if game.Players.LocalPlayer.AccountAge <= 7 then
game.Players.LocalPlayer:Kick("You are not allowed to be here because you have the account age of "..game.Players.LocalPlayer.AccountAge.." days")
end
if game.Players.LocalPlayer.AccountAge == 0<=7 then -- ISSUE ! You can remove it after you fixed it (Line 5)
print(game.Players.LocalPlayer.Name.." joined with the account age of "..game.Players.LocalPlayer.AccountAge.." days and he is not allowed to join in the game.")
if game.Players.LocalPlayer.AccountAge == 1 then
print(game.Players.LocalPlayer.Name.." joined with the account age of "..game.Players.LocalPlayer.AccountAge.." day and he is not allowed to join in the game.")
elseif game.Players.LocalPlayer.AccountAge == 8<=60 then
print(game.Players.LocalPlayer.Name.." joined with the account age of "..game.Players.LocalPlayer.AccountAge.." sounds pretty new, huh ?")
elseif game.Players.LocalPlayer.AccountAge == 61<=150 then
print(game.Players.LocalPlayer.Name.." joined with the account age of "..game.Players.LocalPlayer.AccountAge.." days.")
elseif game.Players.LocalPlayer.AccountAge == 151<=182 then
print(game.Players.LocalPlayer.Name.." joined with the account age of "..game.Players.LocalPlayer.AccountAge.." days. Almost half of the year.")
elseif game.Players.LocalPlayer.AccountAge == 183<=365 then
print(game.Players.LocalPlayer.Name.." joined with the account age of "..game.Players.LocalPlayer.AccountAge.." days. Past of half of the year.")
elseif game.Players.LocalPlayer.AccountAge == 366<=730 then
print(game.Players.LocalPlayer.Name.." joined with the account age of "..game.Players.LocalPlayer.AccountAge.." days. Past a year, now.")
elseif game.Players.LocalPlayer.AccountAge == 731<=1095 then
print(game.Players.LocalPlayer.Name.." joined with the account age of "..game.Players.LocalPlayer.AccountAge.." days. Past 2 year, now.")
elseif game.Players.LocalPlayer.AccountAge == 1096<=1460 then
print(game.Players.LocalPlayer.Name.." joined with the account age of "..game.Players.LocalPlayer.AccountAge.." days. Past 3 year, now.")
elseif game.Players.LocalPlayer.AccountAge == 1461<=1825 then
print(game.Players.LocalPlayer.Name.." joined with the account age of "..game.Players.LocalPlayer.AccountAge.." days. Past 4 year, now.")
elseif game.Players.LocalPlayer.AccountAge <= 1826 then
print(game.Players.LocalPlayer.Name.." joined with the account age of "..game.Players.LocalPlayer.AccountAge.." days. Over 5 year, now. This incredible, this account is still exists, somehow...")
end
end
local BannedUser = {"Eddy0107"}
local LocalPlayer = game.Players.LocalPlayer
local PlayerJoined = game.Players.PlayerAdded
local msg = "You have been permenantly banned for destroying the whole map that took over 5 freaking hours to make ! Now you won't get any chances to be here and that what you GET for destroying a map in progress..."
if table.find(BannedUser, LocalPlayer.Name) then
table.insert(BannedUser, LocalPlayer.Name)
LocalPlayer:Kick(msg)
print(BannedUser.." is permenantly banned !")
end
local localPlayer = game:GetService("Players").LocalPlayer -- the localplayer
local accountAge = localPlayer.AccountAge -- the player's account age
-- it's better to make variables, then to keep indexing
local function isInRange(min: number, max: number) : boolean
-- returns whether or not the player's account age falls within certain days (min, max)
return accountAge == math.clamp(accountAge, min, max)
end
if accountAge <= 7 then
-- This is unsecure, but ok
localPlayer:Kick("You are not allowed to be here because you have the account age of "..accountAge.." days")
end
if isInRange(8, 60) then
-- fill in these spaces with your messages
elseif isInRange(61, 150) then
elseif isInRange(151, 182) then
elseif isInRange(183, 365) then
elseif isInRange(366, 730) then
elseif isInRange(791, 1095) then
elseif isInRange(1096, 1460) then
elseif isInRange(1461, 1825) then
elseif accountAge >= 1826 then
print("over 5 years")
end
local BannedUser = {"Eddy0107"}
local LocalPlayer = game.Players.LocalPlayer
local PlayerJoined = game.Players.PlayerAdded
local msg = "You have been permenantly banned for destroying the whole map that took over 5 freaking hours to make ! Now you won't get any chances to be here and that what you GET for destroying a map in progress..."
if table.find(BannedUser, LocalPlayer.Name) then
table.insert(BannedUser, LocalPlayer.Name)
LocalPlayer:Kick(msg)
end
You’ve got an issue with this line, instead do if game.Players.LocalPlayer.AccountAge >=7 then
2 . You cannot kick a player from a local script, instead use a server script to kick the player.
I’m not sure if you are actually trying to permanently ban a user here, but adding the username into a table will not work and it will be just reset for every player since it’s a local script, instead try using DataStoreService.
Also consider using a table and for loops instead of using that many if statements, it’s a good practice.
Issue at Line 17 / Line 19 / Line 21 / Line 23 / Line 25 / Line 27 / Line 29 / Line 31 and (I guess) Line 33.
local localPlayer = game:GetService("Players").LocalPlayer -- the localplayer
local accountAge = localPlayer.AccountAge -- the player's account age
local accountAgelimitTojoin = 8 -- Limitation to people to the accounts...
-- it's better to make variables, then to keep indexing
local function isInRange(min: number, max: number) : boolean
-- returns whether or not the player's account age falls within certain days (min, max)
return accountAge == math.clamp(accountAge, min, max)
end
if accountAge <= 7 then
wait(1)
localPlayer:Kick("You are not allowed to be here because you have the account age of "..accountAge.." days. You need to be "..accountAgelimitTojoin.." to be able to join in this game !")
end
if isInRange(8, 60) then
print("This account age is "..isInRange(8,60).." days old. This account is now allowed to be placed in here...")
elseif isInRange(61, 150) then
print("This account age is "..isInRange(61,150).." days old. Less then half a year that the account is here...")
elseif isInRange(151, 182) then
print("This account age is "..isInRange(151,182).." days old. More then half a year that the account exists...")
elseif isInRange(183, 365) then
print("This account age is "..isInRange(183,365).." days old. More then half a year that the account exists...")
elseif isInRange(366, 730) then
print("This account age is "..isInRange(366,730).." days old. More then a year that the account exists...")
elseif isInRange(731, 1095) then
print("This account age is "..isInRange(731,1095).." days old. More then 2 years that the account exists...")
elseif isInRange(1096, 1460) then
print("This account age is "..isInRange(1096,1460).." days old. More then 3 years that the account exists...")
elseif isInRange(1461, 1825) then
print("This account age is "..isInRange(1461,1825).." days old. More then over then 4 years that the account exists...")
elseif accountAge >= 1826 then
print("I can't belive it, a player that is 5 years joined the server ! The player's AccountAge is "..accountAge.." days old !")
end
local BannedUser = {"Eddy0107"}
local LocalPlayer = game.Players.LocalPlayer
local PlayerJoined = game.Players.PlayerAdded
local msg = "You have been permenantly banned for destroying the whole map that took over 5 freaking hours to make ! Now you won't get any chances to be here and that what you GET for destroying a map in progress..."
if table.find(BannedUser, LocalPlayer.Name) then
table.insert(BannedUser, LocalPlayer.Name)
LocalPlayer:Kick(msg)
end
local localPlayer = game:GetService("Players").LocalPlayer -- the localplayer
local accountAge = localPlayer.AccountAge -- the player's account age
local accountAgelimitTojoin = 8 -- Limitation to people to the accounts...
-- it's better to make variables, then to keep indexing
local function isInRange(min: number, max: number) : boolean
-- returns whether or not the player's account age falls within certain days (min, max)
return accountAge == math.clamp(accountAge, min, max)
end
if accountAge <= 7 then
wait(1)
localPlayer:Kick("You are not allowed to be here because you have the account age of "..accountAge.." days. You need to be "..accountAgelimitTojoin.." to be able to join in this game !")
end
if isInRange(8, 60) then
print("This account age is "..accountAge.." days old. This account is now allowed to be placed in here...")
elseif isInRange(61, 150) then
print("This account age is "..accountAge.." days old.")
elseif isInRange(151, 182) then
print("This account age is "..accountAge.." days old. Less then half a year that the account exists...")
elseif isInRange(183, 365) then
print("This account age is "..accountAge.." days old. More then half a year that the account exists...")
elseif isInRange(366, 730) then
print("This account age is "..accountAge.." days old. More then a year that the account exists...")
elseif isInRange(731, 1095) then
print("This account age is "..accountAge.." days old. More then 2 years that the account exists...")
elseif isInRange(1096, 1460) then
print("This account age is "..accountAge.." days old. More then 3 years that the account exists...")
elseif isInRange(1461, 1825) then
print("This account age is "..accountAge.." days old. More then 4 years that the account exists...")
elseif accountAge >= 1826 then
print("I can't belive it, a player that is 5 years joined the server ! The player's AccountAge is "..accountAge.." days old !")
end
local BannedUser = {"Eddy0107"}
local LocalPlayer = game.Players.LocalPlayer
local PlayerJoined = game.Players.PlayerAdded
local msg = "You have been permenantly banned for destroying the whole map that took over 5 freaking hours to make ! Now you won't get any chances to be here and that what you GET for destroying a map in progress..."
if table.find(BannedUser, LocalPlayer.Name) then
table.insert(BannedUser, LocalPlayer.Name)
LocalPlayer:Kick(msg)
end