Trying a new style of scripting, where do I indent..?

local testvar = function() return if (function()
end)() then
	(
		function(testParameter, testParameterB)
			local returnValue =
			if testParameter == true then
		(function()
				print("it is true, true!")
				return {"testA", "testB"}
			end)() else (function()
				print("not true, false!")
				return {"testC", "testD"}
			end)()
			return returnValue
		end)(if math.random(1,2) == 1 then true else false, "funny way of coding!") :: {string}
	else (function()
	print("ayyy it works")	
	end)() end

while task.wait(1) do
	testvar()
end

Where am I supposed to indent for this warning to go away?

2 Likes

I can’t really see the issue… :thinking:

It might want you to add an enter for the 8th function call?

Try using the format code option in the script menu.

You can’t fix it as your lines are but with some tweaks:

local testvar = function()
	return if (function() end)() then
		(function(testParameter, testParameterB)
		local returnValue =
			if testParameter == true then
			(function()
				print("it is true, true!")
				return {"testA", "testB"}
			end)() else (function()
				print("not true, false!")
				return {"testC", "testD"}
			end)()
			return returnValue
		end)(if math.random(1,2) == 1 then true else false, "funny way of coding!") :: {string}
	else (function()
		print("ayyy it works")
	end)() end

while task.wait(1) do
	testvar()
end

Obviously don’t actually code like this :slight_smile:

I think I will code like this tbh. It’s quite nice actually

Right click in the script editor, and then click format.