Advertisement
ssccsscc

Layering Helper

Jan 1st, 2018
238
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.20 KB | None | 0 0
  1. local main4 = Window:new(150,60,120,150)
  2. local ButtonSave = Button:new(5, 130, 110, 16, "Ok")
  3. local elname1 = Textbox:new(5, 10, 110, 16)
  4. local elname2 = Textbox:new(5, 30, 110, 16)
  5. local elname3 = Textbox:new(5, 50, 110, 16)
  6. local elname4 = Textbox:new(5, 70, 110, 16)
  7. local elname5 = Textbox:new(5, 90, 110, 16)
  8.  
  9. main4:addComponent(elname1)
  10. main4:addComponent(elname2)
  11. main4:addComponent(elname3)
  12. main4:addComponent(elname4)
  13. main4:addComponent(elname5)
  14. main4:addComponent(ButtonSave)
  15.  
  16. ButtonSave:action(function()
  17. interface.closeWindow(main4)
  18. x,y = sim.adjustCoords(tpt.mousex, tpt.mousey)
  19. if elname5:text()~='' then
  20. sim.partCreate(-3, x,y, tpt.element(elname5:text()))
  21. end
  22. if elname4:text()~='' then
  23. sim.partCreate(-3, x,y, tpt.element(elname4:text()))
  24. end
  25. if elname3:text()~='' then
  26. sim.partCreate(-3, x,y, tpt.element(elname3:text()))
  27. end
  28. if elname2:text()~='' then
  29. sim.partCreate(-3, x,y, tpt.element(elname2:text()))
  30. end
  31. if elname1:text()~='' then
  32. sim.partCreate(-3, x,y, tpt.element(elname1:text()))
  33. end
  34. end)
  35.  
  36. local function toggle(a,b,c,d)
  37. if c==64 and a=="j" and d==1 then   --You can change hotkey here (64 is ctrl)
  38. interface.showWindow(main4)
  39. end
  40. end
  41. tpt.register_keypress(toggle)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement