To get the values you wish to get, you can use pattern matching:
Seperate a string "ws player speed" into {"ws","player", "speed"}:
local arguments = {}
for k in Command.Text:gmatch("[^%s]+") do
arguments[#arguments + 1] = k
end
The pattern "[^%s]+" means that match a set of one one or more characters that do not include a space.
"[]" means match any character inside this.
"^" inside of "[]" means match any characters BUT the following characters in these brackets.
"%s" means space, you may also use " " (an actual space) rather than "%s"
"+" means match one or more of the last item (in this case, the previous item was any item that is not a space).
So, to check and see if the command entered was "ws":
local arguments = {}
for k in Command.Text:gmatch("[^%s]+") do
arguments[#arguments + 1] = k
end
if arguments[1] == "ws" then
if argiments[2] == "me" then
local speed = tonumber(arguments[3])
if speed ~= nil
game.Players.LocalPlayer.Character.Humanoid.Walkspeed = speed
end
end
end
You can learn more about pattern matching in Lua from the official documentation: https://www.lua.org/pil/20.2.html