So this specific line of code is making the value not go over 180 which is correct, but the adding function to get to 180 when it goes over 2 it changes to 180. So basically it works as in not allowing the value to go over 180, but it doesn't let u do it by 1s which is the adding functions and the way its suppose to be done.
No output errors.
Plus.MouseButton1Click:Connect(function()
Number.Text = Number.Text + 1
PlusExample.Text = 180
if Number.Text > PlusExample.Text then Number.Text = 180
end
end)

11 comments
That makes it a string compared to a number which doesn't work
Ew, then i think Example.Text = 180 will work, or you could replace Example.Text at line 3 for 180
It solves that problem, but it still doesn't let it go above 2
Is there some other script affecting this value?
Not that i know of
I did some tests and it seems to work fine for me, i added a print(Number.Text) in the function and it is adding up to 180 without any issues, i guess something in your game could be making this issue, could you say what are you using this script for?
Yes a gui for seat recline
What is the 180 for?Is it the seat angle dregree?
Yes
So i spawned in a new baseplate and tried the script with a basic gui i made and i still have the same problem
Could you share the script via pastebin?Maybe the issue is in the CFrame adding, i made some test with CFrame adding and nothing gone wrong.