Jump to content

Ped Saving


Lalalu

Recommended Posts

Hello, how can I create a PED that when players killed It reappears the next day or at 12 hrs? That it does not appear when you reconnect on the server, only the next day or at specific time.

Edited by Lalalu
Link to comment

If you want something to happen at a specific time, you can call getTime (for in-game time) or getRealTime (for real time) to retrieve the current time and use it to calculate the interval from the current moment to that specific time. Then call setTimer with that interval. To make a ped reappear after death, you would do all of that in setPedWasted event, destroying the old ped and creating a new one from within the function passed to setTimer.

Link to comment

Hi , I Hope I Can Help You 😄

Try This Code ( Server-Side) : 
 

local TimeToSpawnAgian = 12 -- Hour (Example : 12 Hour)

pedir = createPed(0,-2413.10327, -599.83673, 132.56250) -- Createing Ped

addEventHandler("onPedWasted",getRootElement(),function()
    if source == pedir then
setTimer(function()
    destroyElement(pedir) -- Destroy To Optimizing
    pedir = createPed(0,-2413.10327, -599.83673, 132.56250) -- Create Again
end,TimeToSpawnAgian * 3600000,1) -- Set Time To Spawn After Ped Dead
end
end)


I Tested This Code And Thats Work Successfully ❤️ 

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