SetPickupRegenerationTime() not working as expected

As said in the title, SetPickupRegenerationTime does not seem to be working as expected. I am trying to randomly regen pickups but they seem to respawn in around a minute or 2 no matter how high i set the number to. My question is, am i using this right and if not what are the correct values to use?

pickuptime =  math.random(64000, 172000)
pickup = CreatePickup(loot[hashofitem], item.x, item.y, item.z)
SetPickupRegenerationTime(pickup, pickuptime)

Moved to #development:scripts . This is not a release.

1 Like

Have you tried setting it to the 600000 value as the example states? That should give it 10 minutes before it respawns (according to the native db)
45

1 Like

Just tested with 900000 and respawned in just over a minute. :persevere:

What about the 600000 though? Some things have limits and if 600000 is a known value from a R* script it should work…

Is still respawning in around a minute, seems like i am either missing something or it is not working as expected.

    local newloot = {
    {drop=0x9CF13918, model=0xD205520E},-- PICKUP_WEAPON_HEAVYPISTOL / WEAPON_HEAVYPISTOL
    {drop=0xDF711959, model=0x83BF0278},-- PICKUP_WEAPON_CARBINERIFLE / WEAPON_CARBINERIFLE
    }
            pickuptime = 600000
            newloots = newloot[lootitemnum]
            pickup = CreatePickupRotate(newloots.drop, item.x, item.y, item.z, item.x, item.y, item.z, 512, 120, true, true, newloots.model)
            SetPickupRegenerationTime(pickup, pickuptime)

Not sure whats wrong :confused:

Have you experimented with this? E.g. using an int as the seconds? It seems other people are using “60” as a value (I’m assuming to represent 60 seconds).

ya just tried with 600, 6000, 600000 and still respawns in one minute, but does give me max ammo when higher than 16 and 32 lol