Jump to content

Learn script


franku

Recommended Posts

DX functions return only boolean value. That means it's true (if created successfully) or false (otherwise).

That is a bit harder. You'll have to calculate their intersections. Like this (based on my example):

addEventHandler("onClientClick", root, 
    function(button, state, x, y) 
        if button == "left" and state == "down" then 
            for i=1, 12 do 
                if x >= 500 and x <= 500+50 and y >= 100+(i*50) and y <= 100+(i*50)+30 then 
                    outputChatBox("Pressed on rectangle number "..i) 
                end 
            end 
        end 
    end 
) 

Link to comment

ipairs/pairs is used when you're looping through a table. We are using so-called numeric for which loops through specific chunk and returns current processed number based on what numbers you expressed as values in for loop.

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...