SetPickupRegenerationTime() not working as expected

help
createpickup

#1

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)

SetPickupRegenerationTime is not setting regeneration time in LUA, no matter the value
#2

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


#3

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


#4

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


#5

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


#6

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)

#7

Not sure whats wrong :confused:


#8

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


#9

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