Jump to content

Pickups


isa_Khamdan

Recommended Posts

Is there any script in the community that create pickups in a selected area but in random places in the selected area and when you take the pickup the player will get amount of money and another pickup will spawn directly in another location

so if there is a script like that can someone give me the link for it and if not just tell me how to make one and I will script it myself :)

Link to comment

you need to

createColRectangle 
createPickup -- there you need to create 2,3,4 table with pickups.. for math.random, when you use the command on a colRectangle, then.. to start a math.random on pickups in that area. 
math.random 
givePlayerMoney 
unpack 
--Events 
"addCommandHandler" 
"onPickupHit" 

Link to comment

Managed to get it fixed? Else I could give you a little hand. :)

@goluna21; you dont need to use the "createColRectangle" function. Why dont you just use the math.random and give it 2 parameters.

local posX, posY, posZ = getElementPosition ( source ); 
local X = math.random ( posX - 150, posX + 150 ); 
local Y = math.random ( posY - 150, posY + 150 ); 
local pickup = createPickup ( X, Y, posZ, 3, 1212 ); 

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