Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local main4 = Window:new(150,60,120,150)
- local ButtonSave = Button:new(5, 130, 110, 16, "Ok")
- local elname1 = Textbox:new(5, 10, 110, 16)
- local elname2 = Textbox:new(5, 30, 110, 16)
- local elname3 = Textbox:new(5, 50, 110, 16)
- local elname4 = Textbox:new(5, 70, 110, 16)
- local elname5 = Textbox:new(5, 90, 110, 16)
- main4:addComponent(elname1)
- main4:addComponent(elname2)
- main4:addComponent(elname3)
- main4:addComponent(elname4)
- main4:addComponent(elname5)
- main4:addComponent(ButtonSave)
- ButtonSave:action(function()
- interface.closeWindow(main4)
- x,y = sim.adjustCoords(tpt.mousex, tpt.mousey)
- if elname5:text()~='' then
- sim.partCreate(-3, x,y, tpt.element(elname5:text()))
- end
- if elname4:text()~='' then
- sim.partCreate(-3, x,y, tpt.element(elname4:text()))
- end
- if elname3:text()~='' then
- sim.partCreate(-3, x,y, tpt.element(elname3:text()))
- end
- if elname2:text()~='' then
- sim.partCreate(-3, x,y, tpt.element(elname2:text()))
- end
- if elname1:text()~='' then
- sim.partCreate(-3, x,y, tpt.element(elname1:text()))
- end
- end)
- local function toggle(a,b,c,d)
- if c==64 and a=="j" and d==1 then --You can change hotkey here (64 is ctrl)
- interface.showWindow(main4)
- end
- end
- tpt.register_keypress(toggle)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement