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

Help detecting GUI Collision?

Asked by 10 years ago

I tried to make a function that detects collision, but it is faulty. Could someone please make it better?

function withingui(gui,position)
    if
        position.X.Offset >= gui.Position.X.Offset and
        position.X.Offset <= gui.Position.X.Offset+gui.Position.X.Offset and
        position.Y.Offset >= gui.Position.Y.Offset and
        position.Y.Offset <= gui.Position.Y.Offset+gui.Position.Y.Offset
        then
        print("Intersecting")
        return true
    else
        return false
    end
end

1 answer

Log in to vote
0
Answered by 10 years ago

As ScriptingHelpers rule says:

Don't ask for codes, explain your problem and then we try to help you.

Ad

Answer this question