Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

how do kick command with theese settings?

Asked by 10 years ago

owner = ("dragojake1013") -- the owner

admins = ("meltdown878") -- the admins

prefix = (":") -- you can change the prefix

function onchatted ()

end

(this is were the function goes but not in parenthisies)

im no sure what o do here but i now its something onchatted

0
Please use proper grammar. Plus it's easy. Just follow the wiki User#35 0 — 10y

1 answer

Log in to vote
0
Answered by
BlackJPI 2658 Snack Break Moderation Voter Community Moderator
10 years ago

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)
0
thanks that helped dragojake1013 0 — 10y
0
No problem :) BlackJPI 2658 — 10y
Ad

Answer this question