Compairing string to number in a textbox

I know, right? You can also use:

if (((((true))))) then

end

Or even, my favorite:

if ((((((((((((((((((not not not not {}))))))))))))))))) then

end
point is, that using () unnecessarily is ugly and unneeded.
1 Like

give you what? I am sort of confused, please elaborate further.

What is the point of this comment?

Make fun of my styling?

if so you are only making you look like a fool, everyone has their own style.
You shouldn’t judge one by their style.

Also adding () can sometimes be beneficial so please don’t speak about things you don’t fully have a grasp on :smile:

You discord so I can help you realtime if you want ofcourse!

That’s correct! However, using it when you obviously don’t need to makes it ugly and takes those two longer milliseconds to write.

For example, using parenthesis is needed:

(2 * 3) + 2 == 8 -- true

However, using parenthesis is useless in this example:

(2 + 3) == 5 -- true with/without parenthesis 

In fact, most modern IDEs throw warnings if you dare use your inefficient “coding style” in places where you don’t need to.

hmm no thank you, i might put this in the code review now that you guys solved it

Still, there is no wrong coding style, since everyone has their own opinions on stuff, for you it may be inefficient and ugly, but most people I worked with they liked it because it keeps everything tidy and easy to read, also why would I care about other IDE’s if I’m using LuaU?

No issues with that. With that take on coding, you might as well use Instance.new() with the parent argument to cause some memory leaks :smiley:

My point was that using () unnecessarily in places where it obviously doesn’t matter in terms of functionality and readability (such as if (true) then) is looked upon as a bad practice.

Let’s stop arguing or this silly moderation team will take our posts down.

By the way what I meant for the function is to do this:

local button = script.Parent
local drop = game.ReplicatedStorage.Dropping
local player = game.Players.LocalPlayer

function FuncName(Material)
	local number = button.Parent.TextBox.Text
	if tonumber(number) <= tonumber(player.Resources:FindFirstChild(Material).Value) then
		print("yesss")
		--drop:FireServer(Material, number)
	elseif tonumber(number) >= tonumber(player.Resources:FindFirstChild(Material).Value) then
		button.TextColor3 = Color3.new(0.985946, 0, 0.0406043)
		button.Text = "INVAILD NUMBER"
		wait(2)
		button.TextColor3 = Color3.new(255,255,255)
		button.Text = "Drop"
	end 
end

button.MouseButton1Click:Connect(FuncName, Put_the_material_you_want_here)

isn’t the first function reserved for the player?
like this

function(plr,something_else)

What?

I’m pretty sure you mean like a server function, on the client functions don’t need the player argument/parameter and this script is on the client so you can just use the function