In this script, the goal is, once the Udim.Y value of a scroll frame exceeds 700 it makes a button interactable. The issue is, I cannot compare the valies.
I’ve tried:
if MainFrame.Parent.RuleMeny.Co
ntent.CanvasSize.Y >= 700 then
-- code
end
I’ve also tried -700 and converting (y) to a number
lelion77
(lelion77)
August 7, 2024, 9:47pm
#2
Well this is how UDIM2 looks on a scrollframe
so you would have to do .Size.Y.Scale
or .Size.Y.Offset
to get the number value
Well if you read my issue you can clearly see I’m working with a “CanvasSize” which is Udim not Udim2, they are two completely seperate things.
lelion77
(lelion77)
August 7, 2024, 9:51pm
#4
oh my bad but you still have to specify if you want to check the offset value or scale value so
if MainFrame.Parent.RuleMeny.Co
ntent.CanvasSize.Y.Scale >= 700 then
-- code
end
or
if MainFrame.Parent.RuleMeny.Co
ntent.CanvasSize.Y.Offset >= 700 then
-- code
end
Okay so update, I was a bit daft when posting. It’s CanvasPosition. Ill post with the errors.
lelion77
(lelion77)
August 7, 2024, 10:21pm
#6
You’re printing MainFrame.Parent.RuleMenu.Content.CanvasPosition.Y
and it’s working but in the if statement you’re still checking CanvasSize.Y
thanks dude, im really tired rn
lelion77
(lelion77)
August 7, 2024, 10:42pm
#8
all good it happens lmao
Ttttttt
system
(system)
Closed
August 21, 2024, 10:42pm
#9
This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.