Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

Why is my script being difficult for no reason?

local MinSize = UDim2.new(0.992, 0,0, 0)
local MaxSize = UDim2.new(0.992, 0,7.091, 0)

script.Parent.InputBegan:Connect(function(input)
	if input.UserInputType == Enum.UserInputType.MouseButton1 then
		print(script.Parent.Frame.Size.X.Scale)
		if script.Parent.Frame.Size == MinSize then
-- stuff

It doesn't matter how much I calibrate this, my script just refuses to acknowledge that my UI is the exact size as MinSize

3 comments

0

Your question is too vague, can you clarify?

0

Essentially, the if statement won't run despite my UI matching the correct size.

0

if script.Parent.Frame.Size == UDim2.new(MinSize) then <- you have to compare with UDim2 since that's what value is being used.

1 answer

My closest guess os that your gui is larger than minsize, and all you need to do is replace the == on line 7 with >=. This is all I can help without more knowledge of your code and issue.

This discussion is preserved as it was. New answers, comments, and votes are closed.