Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

how do i check if a frame Position is grater than udim2?

Asked by 7 years ago

So i tried searching the wiki trying to figure this out but i cant find anything. Basically i am making an rbg color creator for random reasons And i dont want it to drag out side the frame so i am making and if statement that checks if the position is grater than the udim.

player = game.Players.LocalPlayer
mouse = player:GetMouse()

dragging = false

function drag()
    while dragging == true do

        if script.Parent.Position >= UDim2.new(0,255,0,0) then
            print(34)
        end
        script.Parent.Position = UDim2.new(0,mouse.X - 225,0,0)
--[[^^^^^^^^^^^^^^^^^^dont worry about this i set it up so it puts the gui on the mouse]]       
        wait()
    end
end

script.Parent.DragBegin:connect(function()
    dragging = true
    drag()
end)

script.Parent.DragStopped:connect(function()
    dragging = fals
end)
0
ik that much but im trying to make it to were is dose not go out side a frame TheScriptKing 102 — 7y
0
Use AbsolutePosition and AbsoluteSize to compare Gui objects. Pejorem 164 — 7y

Answer this question