Advertisement
huncrys

Untitled

May 22nd, 2018
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. local hiding = false
  2.  
  3. local function toggleObjects(show)
  4.     local objects = getElementsByType("object")
  5.     for _, object in ipairs(objects) do
  6.         local id = getElementModel(object)
  7.         if ids[id] then
  8.             setElementDimension(object, show and 0 or 1)
  9.         end
  10.     end
  11. end
  12.  
  13. bindKey("N", "down", function ()
  14.     hiding = not hiding
  15.  
  16.     toggleObjects(hiding)
  17. end)
  18.  
  19. addEventHandler("onClientMapStarting", resourceRoot, function ()
  20.     if hiding then
  21.         toggleObjects(false)
  22.     end
  23. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement