Guest User

respawnDoors.lua v0.1

a guest
Aug 2nd, 2025
29
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.98 KB | None | 0 0
  1. -- respawnDoors.lua by rixi
  2. -- add reset doors to respawnRooms.lua
  3. -- untested v0.1
  4.  
  5. local respawnDoors = {}
  6.  
  7. local respawnRooms = require("respawnRooms")
  8.  
  9.  
  10.  
  11. local warpMap = {}
  12.  
  13.  
  14. function respawnDoors.registerIDs(idList)
  15.     local allWarps = Warp.get()
  16.  
  17.     for  _,v in ipairs(idList)  do
  18.         if  #allWarps >= v  then
  19.             local thisWarp = allWarps[v]
  20.             warpMap[thisWarp] = true
  21.         end
  22.     end
  23. end
  24.  
  25. function respawnDoors.clearIDs(idList)
  26.     local allWarps = Warp.get()
  27.  
  28.     for  _,v in ipairs(idList)  do
  29.         if  #allWarps >= v  then
  30.             local thisWarp = allWarps[v]
  31.             warpMap[thisWarp] = nil
  32.         end
  33.     end
  34. end
  35.  
  36.  
  37.  
  38. function respawnDoors.onInitAPI()
  39.     registerEvent(respawnDoors, "onWarpEnter")
  40. end
  41.  
  42. function respawnDoors.onWarpEnter(eventToken, warpObj, playerObj)
  43.     if  warpMap[warpObj]  then
  44.         eventToken.cancelled = true
  45.         respawnRooms.reset(false)
  46.     end
  47. end
  48.  
  49.  
  50.  
  51. return respawnDoors
Advertisement
Add Comment
Please, Sign In to add comment