I just wanted to know, how would I be able to make a /kick command?
I mean, I could literally just use the console but that’s boring
This is my script:
if player:GetRankInGroup(8423759) == 7 then
player.Chatted:Connect(function(msg)
if msg.match("/e kick") then
local plrToKickName = msg:split(' ')[2]
local plrToKick = Players:FindFirstChild(plrToKickName)
if plrToKick then
player:Kick("You have been kicked from Eternity 2000!")
Please help!
*(If you are wondering why it’s ‘Eternity 2000’ it’s because our game. Take a look if you want: Eternity 2000 - Roblox)
If the script isn’t working then thats because it only works for people that have a group role rank of 7, since you own the group, your group role would be 255, so to fix that you should use a >= instead of ==.
So this:
Would be: if player:GetRankInGroup(8423759) >= 7 then
If the script still doesn’t work then PLEASE show any errors the script has.
local cmds = {
["/kick"] = function(args) -- CMD USAGE: "/kick user reason"
local plr = args[2]
table.remove(args, 1)
table.remove(args, 2)
local reason = table.concat(args, " ")
for _, v in next, game.Players:GetPlayers() do
if string.lower(v.Name) == string.lower(plr) then
v:Kick("You have been kicked from this game.. You can rejoin")
end
end
end,
}
game.Players.PlayerAdded:Connect(function(player)
if player:GetRankInGroup(8423759) >= 7 then
player.Chatted:Connect(function(msg)
local args = string.split(msg, " ")
cmds[string.lower(args[1])](args)
end)
end
end)