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

How do I make a chatted when someone says ;kill PLAYER, player dies?

Asked by 9 years ago

I tried this:

function findPlayer(name)
    for _, player in ipairs(game.Players:GetPlayers()) do
        if player.Name:lower() == name:lower() then
            return player
        end
    end
end

game.Players.PlayerAdded:connect(function(plr)
    plr.Chatted:connect(function(msg)
        if msg:sub(1,5) == ";kill" then
            victim = findPlayer(msg:sub(7))
            if victim and victim.Character then
                victim.Character:BreakJoints()
            end
        end
    end)
end)

but I always get a error saying

0
As your current script is, you'd have to type it as ';killAlpha', it's not set to do ';kill Alpha'. TheeDeathCaster 2368 — 9y
0
oh, let me edit it Operation_Meme 890 — 9y

Answer this question