I’m making admin commands for my game but whenever I try to run :test it’s doesn’t work, there’s no errors in the output.
local config = require(game:GetService("ServerScriptService").Solar.Setup:FindFirstChild("Config"))
local Datastores = game:GetService("DataStoreService")
local PlayerService = game:GetService("Players")
function CheckPermLevel(userId)
if table.find(config.SuperAdmin, userId) then
return 3
elseif table.find(config.Admin, userId) then
return 2
elseif table.find(config.Mod, userId) then
return 1
elseif userId == game.CreatorId then
return 4
elseif table.find(config.Banned, userId) then
return -1
else
return 0
end
end
function CheckBan(userId)
local PlayerKey = Datastores:GetDataStore(userId.."91213924014EpzS@laréâ")
if CheckPermLevel(userId) >= 1 then
if table.find(config.Banned, userId) then return table.remove(config.Banned, userId) end
if PlayerKey:GetAsync(userId.."91213924014EpzS@laréâ","-BAN") then return PlayerKey:GetAsync(userId.."91213924014EpzS@laréâ") end
else
if PlayerKey:GetAsync(userId.."91213924014EpzS@laréâ","-BAN") or table.find(config.Banned, userId) then
local getPlrNameByID = PlayerService:GetNameFromUserIdAsync(userId)
getPlrNameByID:Kick("[Solar] You are banned from this server.")
end
end
end
game.Players.PlayerAdded:Connect(function(player)
local PlayerKey = Datastores:GetDataStore(player.UserId.."91213924014EpzS@laréâ")
if PlayerKey:GetAsync(player.UserId.."91213924014EpzS@laréâ","-BAN") or table.find(config.Banned, player.UserId) then
CheckBan(player.UserId)
else
PlayerKey:SetAsync(player.UserId.."91213924014EpzS@laréâ")
if CheckPermLevel(player.UserId) >= 1 then
player.Chatted:Connect(function(msg)
local argument = msg:split(" ")
if argument[1] == ":test" then
if CheckPermLevel(player.UserId) == 4 then
return print("test")
else
return warn("Not high enough to execute "..config.Prefix.."test, rank: "..CheckPermLevel(player.UserId))
end
end
end)
end
end
end)