Jump to content

Search the Community

Showing results for tags 'createpickup'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • Multi Theft Auto: San Andreas 1.x
    • Support for MTA:SA 1.x
    • User Guides
    • Open Source Contributors
    • Suggestions
    • Ban appeals
  • General MTA
    • News
    • Media
    • Site/Forum/Discord/Mantis/Wiki related
    • MTA Chat
    • Other languages
  • MTA Community
    • Scripting
    • Maps
    • Resources
    • Other Creations & GTA modding
    • Competitive gameplay
    • Servers
  • Other
    • General
    • Multi Theft Auto 0.5r2
    • Third party GTA mods
  • Archive
    • Archived Items
    • Trash

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


Member Title


Gang


Location


Occupation


Interests

Found 1 result

  1. I'm trying to create a custom pickup which gets destroyed when a player touches it, and respawns after 5 seconds I've created the custom pickup using "createPickup", and also placed a colSphere (using "createColSphere") at the same position. When the player hits the pickup for the first time, it disappears and respawns successfully 5 seconds later. However, after it has respawned once, it won't destroy again when you touch it. My code is below. local x = 3985.1799316406 local y = -1973.4870605469 local z = 27.812973022461 pickup = createPickup(x, y, z, 3, 1242) -- create custom pickup pickupCol = createColSphere ( x, y, z, 1) -- create colSphere for pickup function removePickup() destroyElement(pickup) -- destroy pickup destroyElement(pickupCol) -- destroy pickup colsphere setTimer(function() pickup = createPickup(x, y, z, 3, 1242) pickupCol = createColSphere ( x, y, z, 1) end, 5000, 1) -- spawn new pickup and colsphere after 5 seconds end addEventHandler ( "onColShapeHit", pickupCol, removePickup ) Any thoughts? edit: I did try using the respawnTime argument on createPickup, for 5 seconds, but it didn't have any effect, which is why I'm trying to do it this way. No errors returning either.
×
×
  • Create New...