SetPickupRespawnInterval: Difference between revisions
Jump to navigation
Jump to search
m (Needs example) |
m (→See Also) |
||
(2 intermediate revisions by 2 users not shown) | |||
Line 17: | Line 17: | ||
==Example== | ==Example== | ||
<syntaxhighlight lang="lua"> | This example adds 3000ms to the current pickup respawn time. | ||
<syntaxhighlight lang="lua">addEventHandler("onPickUpHit",root,function(player) | |||
</syntaxhighlight> | interval = getPickupRespawnInterval(source) | ||
setPickupRespawnInterval(source,interval + 3000) | |||
outputChatBox("That pickup isn't going to be there until "..tostring(interval).." is done.",player) | |||
end)</syntaxhighlight> | |||
==See Also== | ==See Also== | ||
{{Pickup functions}} | {{Pickup functions|server}} | ||
Latest revision as of 22:37, 6 September 2024
Sets the time it takes for a pickup to respawn after a player picked it up.
Syntax
bool setPickupRespawnInterval ( pickup thePickup, int ms )
Required Arguments
- thePickup: the pickup to set the respawn time of
- ms: the new respawn time in ms
Returns
Returns true if the new respawn time was set successfully, false otherwise.
Example
This example adds 3000ms to the current pickup respawn time.
addEventHandler("onPickUpHit",root,function(player) interval = getPickupRespawnInterval(source) setPickupRespawnInterval(source,interval + 3000) outputChatBox("That pickup isn't going to be there until "..tostring(interval).." is done.",player) end)
See Also
- getPickupRespawnInterval
- isPickupSpawned
- setPickupRespawnInterval
- usePickup
- Shared
- createPickup
- getPickupAmmo
- getPickupAmount
- getPickupType
- setPickupType
- getPickupWeapon