Lalalu Posted July 11, 2023 Share Posted July 11, 2023 (edited) 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 July 11, 2023 by Lalalu Link to comment
DiSaMe Posted July 11, 2023 Share Posted July 11, 2023 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
FallenGod Posted July 13, 2023 Share Posted July 13, 2023 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
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now