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

Comands script?

Asked by 10 years ago

How would i make a script when I say a certain word something happens? EX: I say "Kill" Then it would kill all the players alive or just me.

0
Its impossible. ConnorVIII 448 — 10y
0
@Connor What do you mean? Freemium 110 — 10y
0
He must give up on life. His dreams will never be acomplished ConnorVIII 448 — 10y
0
Oh thanks you so nice, also a guy did it on a script builder with me so yeah it is possible... masterhalo55 75 — 10y
View all comments (4 more)
0
@Connor Impossible? http://goo.gl/BRdmZw User#348 0 — 10y
0
Possable end of descusion. masterhalo55 75 — 10y
0
/whoosh/ Trioxide 79 — 10y
0
..... masterhalo55 75 — 10y

1 answer

Log in to vote
4
Answered by
nate890 495 Moderation Voter
10 years ago
local commands = {
    ["kill"] = function()
        for _, p in pairs(game.Players:GetPlayers()) do
            if p.Character then
                p.Character:BreakJoints()
            end
        end
    end;
}

game.Players.PlayerAdded:connect(function(player)
    player.Chatted:connect(function(msg)
        if commands[msg:lower()] then
            commands[msg:lower()]()
        end
    end)
end)
0
If you wanted to look at a more "advanced" commands script (template) then take a look at this code that I wrote over a year ago: http://pastebin.com/rARwmL5t nate890 495 — 10y
Ad

Answer this question