The title says what my question is; another question that goes along is how do I rewrite the code so I don't have to write it over and over again for every number?

Here is the code

local player = game.Players.LocalPlayer
local textBox = script.Parent
local module = require(game.ReplicatedStorage.Commands)
local folder = Instance.new("Folder", game.Workspace)
folder.Name = player.Character.Name

textBox.FocusLost:Connect(function()
	local text = textBox.Text
    local newText = tostring(text)
	if newText == "New: 0,5,0" then
		-- do something
	elseif newText == "New: 0,10,0" then
		-- do something
	end    
end)

3 comments

0

Is it a Server script?

0

You could use string.sub(1,#text). If text:sub(1,#text) == "New: 0,5,0" then ? elseif text:sub(1,#text) == "New: 0,10,0" then ? end.

0

If you're doing just the y value, you can use a for loop.