Jump to content

Random coords inside radararea?


roaddog

Recommended Posts

Posted

Hi, So how could it be possible to get random coords inside radararea?

You gone learn today.

I work my ass off, but I still can't pay tho.

Posted (edited)

When you create it you could save it's coordinates and size as element data for easy access and then use:

local x = math.random(x_pos, x_pos+x_size) 
local y = math.random(y_pos, y_pos+y_size) 

To get some random coordinates within.

Edited by Guest
Posted

Aint it has to be like

x_pos + x_size on second arg of math.random to get the max x pos? cuz its the size not the pos...

Thank you for the help.

You gone learn today.

I work my ass off, but I still can't pay tho.

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...