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

How to get the text from after msg?

Asked by 5 years ago

Can anyone help me with this? At line 5 or sic everythigng after MSG i need to get in the local message

game.Players.PlayerAdded:Connect(function(player)
    player.Chatted:Connect(function(msg)
        if player:GetRankInGroup(4560171) > 10 then -- Zet groep tussen () e, 3 naar welke rank erboven allemaal het kan doen
            if string.find(msg, "!msg ") then
                local message = string.sub(msg, 6)
                game.ReplicatedStorage.announcements.send:FireAllClients(message)
            elseif string.sub(msg, 1,9) == "!shutdown" then
                local players = game.Players:GetPlayers()
                for i, v in pairs(players) do
                    v:Kick("shutdown")
                end
            end

        end
    end)
end)

Answer this question