I’m making an admin command system which has a gameban command in it. My previous posts have showed a little what I want with a notification system.
For the game ban, I want it so it permanently bans them from my game. It keeps on saying invalid player when I type in my user correctly.
Example of what I want:
Admin: /gameban Comqts
User gets banned
If it’s an invalid player:
Admin: /gameban InvalidPlayer
Notification: Player is invalid.
What I keep getting
Admin: /gameban Comqts
Notification: Player is invalid.
SSS_COMMAND_SCRIPT
elseif string.sub(Message, 1 ,8) == "/gameban" and table.find(permissions.gameban, AdminLevel) then
local Target = game.Players:FindFirstChild(string.sub(Message,10,string.len(Message)-string.len(string.sub(Message,10))-1))
if Target ~= nil then
game:GetService("DataStoreService"):GetOrderedDataStore("PermBanList"):SetAsync(Target.UserId.."_GameBanned")
Player:Kick("You have been banned from the game.")
else
game.ReplicatedStorage.Notification:FireClient(Client, "COMMANDS", "Player is Invalid")
end;
LOCAL_SCRIPT_NOTIFICATION
game.ReplicatedStorage.Notification.OnClientEvent:Connect(function(Type, CommandsList)
local startergui = game:GetService("StarterGui")
local text = ""
if Type == "COMMANDS" then
if typeof(CommandsList) == "string" then
text = CommandsList
else
for _, command in pairs(CommandsList) do
text = text .. "\n"..command
end
end
end
startergui:SetCore("SendNotification", {
Title = "NOTIFICATION",
Text = text
})
end)
If anyone has suggestions, please help.