✓ Accepted answer
You need to detect who spoke, if they can call commands, if the command was kick, who they are trying to kick, and lastly you need to shut down their client (roblox has an method, :Kick(), designed specifically for this).
local canUseCommands = {PlayerName, OtherPlayerName, AnyotherPlayerName}
game.Players.PlayerAdded:connect(function(player)
player.Chatted:connect(function(message)
if message == 'kick/' and canUseCommands[player.Name] then
if game.Players:FindFirstChild(string.sub(msg, 6)) then
game.Players:FindFirstChild(string.sub(msg, 6)):Kick()
end
end
end
end)
1 comment
Please use proper grammar. Plus it's easy. Just follow the wiki