So basically I am creating a button so when you click it, it checks if you selected a type of art then it checks if actually entered something into the info box. If I select a type with or without entering the info and I click order it gives this error: Players.TypicallyPacific.PlayerGui.ScreenGui.StandardOrder.Order.LocalScript:5: attempt to compare number with function. How would I fix this?
local button = script.Parent button.MouseButton1Click:Connect(function(player) if button.Parent.Values.Type.GFX.Value == true or button.Parent.Values.Type.Drawing.Value == true then if button.Parent.OrderInfo.Text.len >= 1 then button.BackgroundColor3 = Color3.fromRGB(85, 255, 127) wait(2) button.BackgroundColor3 = Color3.fromRGB(227, 227, 227) else button.BackgroundColor3 = Color3.fromRGB(255, 0, 0) button.Parent.OrderInfo.BackgroundColor3 = Color3.fromRGB(255, 0 ,0) wait(2) button.BackgroundColor3 = Color3.fromRGB(227, 227, 227) button.Parent.OrderInfo.BackgroundColor3 = Color3.fromRGB(227, 227, 227) end else button.BackgroundColor3 = Color3.fromRGB(255, 0, 0) button.Parent.Drawing.BackgroundColor3 = Color3.fromRGB(255, 0, 0) button.Parent.GFX.BackgroundColor3 = Color3.fromRGB(255, 0, 0) button.Parent.Type.BackgroundColor3 = Color3.fromRGB(255, 0, 0) wait(2) button.BackgroundColor3 = Color3.fromRGB(227, 227, 227) button.Parent.Drawing.BackgroundColor3 = Color3.fromRGB(227, 227, 227) button.Parent.GFX.BackgroundColor3 = Color3.fromRGB(227, 227, 227) button.Parent.Type.BackgroundColor3 = Color3.fromRGB(227, 227, 227) end end)
this should help
local text = button.Text print(string.len(text))