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

How do you allow for a third input in chat commands?

Asked by 5 years ago
Edited 5 years ago
game.Players.PlayerAdded:connect(function(plr)
    plr.Chatted:connect(function(m)
     local msg = string.lower(m)
        if msg:sub(1,7) == ":theme " then
            if plr:GetRankInGroup(4184921) >= 200 then
                if themechosen == false then
                    themechosen = true
                    theme = string.upper(msg:sub(8))
                    open = true
                    event:FireAllClients(string.upper(msg:sub(8)),"open")
                end
            end
    end
end 

okay so i am trying to create a chat command where there would be 2 inputs, like :theme input1 input2, where input2 would be a countdown. how would i be able to find the 2nd input (time) in the string with :sub when the first input (the theme) doesn't have a consistent length?

0
Find the text after "birthday time " User#19524 175 — 5y
0
RBXScriptSignal:connect() is deprecated, you should switch to RBXScriptSignal:Connect() btw. User#19524 175 — 5y
0
I recommend using string patterns for this purpose. http://robloxdev.com/articles/string-patterns-reference TheeDeathCaster 2368 — 5y

Answer this question