Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local px=-1
- local py=-1
- local portalcolor = "orange"
- function unreg(x)
- tpt.unregister_step(x)
- end
- function reg(x)
- tpt.register_step(x)
- end
- local portalelement = "prti"
- local ESMD = elements.allocate("ESMD", "FATE")
- elements.element(elements.ESMD_PT_FATE, elements.element(tpt.element("PHOT")))
- elements.property(elements.ESMD_PT_FATE, "Name", "FATE")
- elements.property(elements.ESMD_PT_FATE, "Description", "field of anti-expropriation")
- elements.property(elements.ESMD_PT_FATE, "MenuVisible", 1)
- elements.property(elements.ESMD_PT_FATE, "MenuSection", 3)
- elements.property(elements.ESMD_PT_FATE, "HighPressure", 999999)
- elements.property(elements.ESMD_PT_FATE, "Colour", 0xFF127BC1)
- elements.property(elements.ESMD_PT_FATE, "Temperature", 0+273.15)
- function FATE(i, x, y, s, n)
- local ctype= tpt.get_property("ctype",i)
- if math.random(1,50)==1 then tpt.set_property("vy",-1,i)end
- if math.random(1,50)==1 then tpt.set_property("vy",1,i)end
- if tpt.get_property("vx",i)==0 then else tpt.set_property("vx",0,i) end
- if tpt.get_property("type",x,y+1)==0 or tpt.get_property("type",x,y+1)==tpt.element("FATE") then else tpt.set_property("vy",-1,i) end
- if tpt.get_property("type",x,y-1)==0 or tpt.get_property("type",x,y-1)==tpt.element("FATE") then else tpt.set_property("vy",1,i) end
- if tpt.get_property("type",x,y)==ctype then tpt.delete(i) tpt.delete(x,y) end
- end
- tpt.element_func(FATE,tpt.element("FATE"))
- local ESMD = elements.allocate("ESMD", "PRTB")
- elements.element(elements.ESMD_PT_PRTB, elements.element(tpt.element("PHOT")))
- elements.property(elements.ESMD_PT_PRTB, "Name", "PRTB")
- elements.property(elements.ESMD_PT_PRTB, "Description", "portal ball")
- elements.property(elements.ESMD_PT_PRTB, "MenuVisible", 0)
- elements.property(elements.ESMD_PT_PRTB, "MenuSection", 0)
- elements.property(elements.ESMD_PT_PRTB, "HighPressure", 999999)
- elements.property(elements.ESMD_PT_PRTB, "Colour", 0xFF127BC1)
- elements.property(elements.ESMD_PT_PRTB, "Temperature", 0+273.15)
- function portalgun(i, x, y, s, n)
- stkmlife = tpt.get_property("life",i)
- px = x
- py = y
- if tpt.get_property("tmp",i) ==0 then tpt.register_step(drawportalgun) tpt.set_property("tmp",i) end
- if tpt.get_property("tmp",i) ==nil then tpt.unregister_step(drawportalgun) end
- end
- tpt.element_func(portalgun,tpt.element("STK2"))
- function drawportalgun()
- if px<8 or px>604 or py<8 or py>376 or stkmlife <=50 then tpt.unregister_step(drawportalgun) end
- if portalgunset == 1 then
- tpt.drawline(px,py+3,px+2,py+5,100,100,255)
- tpt.drawpixel(px+3,py+5,100,100,255)
- tpt.drawline(px+4,py+5,px+4,py+6,204,204,204)
- tpt.drawpixel(px+5,py+4,204,204,204)
- tpt.drawpixel(px+6,py+4,255,185,0)
- tpt.drawrect(px+5,py+5,1,1,239,239,239)
- tpt.drawline(px+5,py+7,px+6,py+7,170,170,170)
- tpt.drawline(px+7,py+6,px+6,py+4,170,170,170)
- tpt.drawline(px+8,py+5,px+10,py+4,48,48,48)
- tpt.drawline(px+8,py+6,px+10,py+7,32,32,32)
- end
- if portalgunset == 2 then
- tpt.drawline(px,py+3,px-2,py+5,100,100,255)
- tpt.drawpixel(px-3,py+5,100,100,255)
- tpt.drawline(px-4,py+5,px-4,py+6,204,204,204)
- tpt.drawpixel(px-5,py+4,204,204,204)
- tpt.drawpixel(px-6,py+4,255,185,0)
- tpt.drawrect(px-6,py+5,1,1,239,239,239)
- tpt.drawline(px-5,py+7,px-6,py+7,170,170,170)
- tpt.drawline(px-7,py+6,px-6,py+4,170,170,170)
- tpt.drawline(px-8,py+5,px-10,py+4,48,48,48)
- tpt.drawline(px-8,py+6,px-10,py+7,32,32,32)
- end
- end
- local ESP = 0
- function keyfix(key_char)
- if ESP ==2 then ESP = 0 end
- if key_char == "v" then ESP = ESP+1 end
- if key_char == "c" then ESP = ESP+1 end
- if key_char == "a" then ESP = ESP+1 end
- if key_char == "d" then ESP = ESP+1 end
- if key_char == "]" then ESP = ESP+1 print(ESP) end
- end
- tpt.register_keypress(keyfix)
- function portalgunshotkey(key_char)
- if key_char == "v" and portalgunset == 1 and ESP == 2 then tpt.create(px+12,py+5,tpt.element("PRTB")) end
- if key_char == "v" and portalgunset == 2 and ESP == 2 then tpt.create(px-12,py+5,tpt.element("PRTB")) end
- if key_char == "c" and portalgunset==0 and ESP == 2 then portalgunset=math.random(1,2) end
- if key_char == "c" and portalgunset==math.random(1,2) and ESP == 0 then portalgunset=0 end
- if key_char == "a" and ESP == 2 then portalgunset=2 end
- if key_char == "d" and ESP == 2 then portalgunset=1 end
- end
- tpt.register_keypress(portalgunshotkey)
- function portballfunc(i, x, y, s, n)
- deleteportal = 1
- local tmp2 = tpt.get_property("tmp2",i)
- if tmp2 == 0 then tpt.set_property("tmp2",portalelement,i) end
- if tpt.get_property("tmp2",i) == tpt.element("prti") then deleteportal=1 end
- if tpt.get_property("tmp2",i) == tpt.element("prto") then deleteportal=2 end
- if tpt.get_property("tmp",i) == 0 and portalgunset ==1 then tpt.set_property("tmp",1,i) tpt.set_property("vx",1,i) end
- if tpt.get_property("tmp",i) == 0 and portalgunset ==2 then tpt.set_property("tmp",2,i) tpt.set_property("vx",-1,i) end
- if tpt.get_property("type",x+1,y) == 0 then else tpt.set_property("vx",0,i) tpt.delete(i)
- deleteportal = 0
- for goup =1,9 do
- tpt.set_property("temp",9999,tpt.create(x,y-goup,tmp2))
- if tpt.get_property("type",x+1,y-goup) ==0 then break end
- if tpt.get_property("type",x,y-goup) ==0 or tpt.get_property("type",x,y-goup) ==tmp2 then else break end
- end
- for godown =0,5 do
- tpt.set_property("temp",9999,tpt.create(x,y+godown,tmp2))
- if tpt.get_property("type",x+1,y+godown) ==0 then break end
- if tpt.get_property("type",x,y+godown) ==0 or tpt.get_property("type",x,y+godown) ==tmp2 then else break end
- end
- end
- if tpt.get_property("type",x-1,y) == 0 then else tpt.set_property("vx",0,i)
- tpt.delete(i)
- deleteportal = 0
- for goup =1,9 do
- tpt.set_property("temp",9999,tpt.create(x,y-goup,tmp2))
- if tpt.get_property("type",x-1,y-goup) ==0 then break end
- if tpt.get_property("type",x,y-goup) ==0 or tpt.get_property("type",x,y-goup) ==tmp2 then else break end
- end
- for godown =0,5 do
- tpt.set_property("temp",9999,tpt.create(x,y+godown,tmp2))
- if tpt.get_property("type",x-1,y+godown) ==0 then break end
- if tpt.get_property("type",x,y+godown) ==0 or tpt.get_property("type",x,y+godown) ==tmp2 then else break end
- end
- end
- end
- tpt.element_func(portballfunc,tpt.element("PRTB"))
- local tl = 0
- function clickstikman(x, y, b, e)
- if b==1 and e ==1 and x> px-15 and y>py-22 and x<px and y<py-10 and drawguitest and portalcolor=="orange" then portalcolor2="blue" end
- if b==1 and e ==1 and x> px-15 and y>py-22 and x<px and y<py-10 and drawguitest and portalcolor=="blue" then portalcolor2="orange" end
- if b==2 and e==1 and tl==1 then
- drawguitest = false
- tpt.unregister_step(drawgui)
- tl=2
- end
- if x>px-2 and x<px+2 and y>py-2 and y<py+2 and b==1 and e==1 and tl==0 then
- drawguitest = true
- tpt.register_step(drawgui)
- tl = 1
- end
- if tl==2 then tl = 0 end
- --fix lua bug
- if portalcolor2 == "blue" then portalcolor = "blue" portalelement = "prto" end
- if portalcolor2 == "orange" then portalcolor = "orange" portalelement = "prti" end
- if deleteportal2 == 1 then deleteportal = 0 end
- if deleteportal2 == 2 then deleteportal = 0 end
- end
- tpt.register_mouseclick(clickstikman)
- function drawgui()
- if portalcolor == "orange" then tpt.drawtext( px-tpt.textwidth("\170 "), py-20, '\170', 234, 88, 22) prtalelement="prti" end
- if portalcolor == "blue" then tpt.drawtext( px-tpt.textwidth("\170 "), py-20, '\170', 31, 234, 255) prtalelement="prto" end
- if portalgunset == 2 then tpt.drawtext( px, py-20, '\150', 192, 192, 192, col) end
- if portalgunset == 1 then tpt.drawtext( px, py-20, '\149', 192, 192, 192, col) end
- tpt.drawrect(px-tpt.textwidth("\170 ")-1,py-21,tpt.textwidth("\170 ")+tpt.textwidth("\150")+2,10)
- end
- function portalfunc(i, x, y, s, n)
- if deleteportal == 1 and tpt.get_property("tmp",i) == 100 then tpt.delete(i) deleteportal2 = 0 end
- end
- tpt.element_func(portalfunc,tpt.element("prti"))
- function portalfunc2(i, x, y, s, n)
- if deleteportal == 2 and tpt.get_property("tmp",i) == 100 then tpt.delete(i) deleteportal2 = 0 end
- end
- tpt.element_func(portalfunc,tpt.element("prto"))
- local cindex = 1
- local cindex2 = 1
- local cindex3 = 1
- function drawname()
- cindex = cindex+1
- cindex2 = cindex2+1.25
- cindex3 = cindex3+1.5
- if cindex >=256 then cindex = 1 end
- if cindex2 >=256 then cindex2 = 1 end
- if cindex3 >=256 then cindex3 = 1 end
- tpt.drawtext(510,412,"electronic_...",cindex,cindex2,cindex3)
- st=1
- end
- function nametest()
- if tpt.get_name() == "electronic_steve" and st==nil then tpt.register_step(drawname) end
- end
- tpt.register_step(nametest)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement