Im trying to add a ban function to my holo commands(I released them on a different account) and I have some questions, first is how in general would this be performed(I have a sketch of something I think it would look like but its not very much) anyways, any help is greatly appreciated.
local admins ={"",}-- What Users(Needs to be EXACT) local bans = {"ProphetCybrax"} local gid = 0 -- What group THIS IS NEEDED local gidranks = {0,0,0,0} -- What Ranks you want NEEDED --Dont Mess with the Below -- -- function contains(list, element) for _, value in pairs(list) do if value == element then return true end end end game.Players.PlayerAdded:connect(function(Xd) if contains(bans, Xd.Name) then for _,i in pairs(bans)do if Xd.Name == i then Xd:Kick() end end end end)
First, we need to detect things that are chatted. Let's look up the Chatted event on the wiki.
It redirected me here. Let's use that:
local admins ={} -- UserIds local bannedPlayers = {} UserIds local groupId = 0 -- What group THIS IS NEEDED local minimumRanks = {0, 0, 0, 0} -- What Ranks you want NEEDED checkRank = function(plrID) for a, admin in pairs(admins) do if admin == plrID then return true end end return false end game.Players.PlayerAdded:connect(function(player) if function( for a, v in pairs(bannedPlayers) do if v == player.UserId then return true end end return false end) then -- If the user is banned when they join, kick them player:Kick() end player.Chatted:connect(function(msg) if checkRank(player) then if msg:find("ban") then local banPlrName = msg:match("ban%s(.+)") for a, v in pairs(game.Players:GetPlayers()) do if v.Name == banPlrName then bannedPlayers[#bannedPlayers + 1] = v.UserId v:Kick() end end end end end) end)