So I decided I wanted to make my own admin, its been going fine till I needed to figure out how to get 2 arguments instead of 1.
Example:(!tp arg1, arg2 )
How would I get argument1 and Argument2 ?
I was using ExampleString:sub(1,4) to get the command then ExampleString:sub(5) to get the first argument but now I don't know how to get the 2nd argument please help :P
I'm not too sure what you mean by Argument 1
and Argument 2
, but taking a guess, I think your talking about a speed/plr/num
type command, luckily, I'm working on a Admin Commands system, so, I'm able to help you out. :D Let me show you;
if msg:lower:(1,6)sub() == "speed/" then --This checks to see if the message starts with 'speed/' [Explanation in Person299's Admin for 'kill/']; This gets the character chatted between 1 and 6 local chk1 = msg:sub(7):find("/") + 6 --This finds the '/' within 'msg:sub(7)' and returns 6 more characters local plrz = GetPlr(plr,msg:sub(7,chk1-1)) --This will get the Player's name [If you have this function] if plrz and plrz.Character and plr.Character:FindFirstChild("Humanoid") then --If the Player, Player's Character, and Characters Humanoid exists then plrz.Character.Humanoid.WalkSpeed = msg:sub(chk1+1) --It'll change the WalkSpeed of the Player to the Number chosen [speed/TheAlphaStigma/16] end --This ends the code block for the 'if' statement end --This ends the code block for the 'if' statement
--Note-- I have tested this in my Admin, and it works. :D Hope this helped!