Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- for _,v in pairs({'disableAutoScore','disableAfkDeath','disablePhysicalConsumables','disableAutoNewGame','disableDebugCommand','disableMinimalistMode','disableMortCommand','disableAutoTimeLeft','disableAutoShaman'}) do
- tfm.exec[v](true)
- end
- maps={"@7189349","@7205073","@7092301"}
- data={}
- p={}
- objects={}
- toDespawn={}
- alive=0
- text={}
- lang={}
- lang.ar={welcome="<vp>#Treasure اهلا بك في<br><rose>!profile او P لفتح الملف الشخصي اضغط",objective="<j>الهدف : قُم بالبحث عن الجبن المختبئ بين الزينة بالظغط على زر النزول لمدة 3 ثواني.",nocheese= "<r>لا يوجد قطعة جبن هنا",cheese="<vp>لقد وجدتَ الجبن ياي",wrongplace="<r>أنت في المكان الخطأ",cheeseplace="<v>لقد تغير مكان الجبن",trap="<r>لقد وقعت في فخ :("}
- lang.en={welcome="<vp>Welcome to #Treasure<br><rose> to show profile press P or Type !profile",objective="<j>Objective: Look for the cheese hidden between the decorations by pressing the down button for 3 seconds",nocheese= "<r>There is no cheese here",cheese="<vp>You found cheese yay",wrongplace="<r>You are in the wrong place",cheeseplace="<v>The place of the cheese has changed",trap=""}
- lang.ro={welcome="<vp>Bine ați venit pe #treasure.<br><rose>Pentru a vedea profilul apăsați tasta P sau scrieți în bara de chat !profile",objective="<j>Obiectivul vostru: găsiți brânza ascunsă sub decorațiuni și colectați-o ținând apăsată săgeata jos pentru 3 secunde",nocheese= "<r>Nu e nicio brânză aici",cheese="<vp>Tocmai ai găsit o brânză! Yay!",wrongplace="<r>Ești într-un loc greșit!",cheeseplace="<v>Locația brânzei a fost schimbată.",trap=""}
- lang.pl={welcome="<vp>Witaj w #Treasure<br><rose> Aby pokazać profil wćiśnij P lub !profile",objective="<j>Cel: Poszukaj seru ukrytego między dekoracjami, naciskając przycisk w dół przez 3 sekundy",nocheese= "<r>Tu nie ma sera",cheese="<vp>Znalazłeś nowy ser!",wrongplace="<r>Jesteś w złej powierzchni",cheeseplace="<v>Miejsce sera uległo zmianie",trap=""}
- function ui.timerImage(img,x,y,n,pet,time)
- time=time or 5
- axis=axis or {100,100}
- local img=tfm.exec.addImage(img..".png","_1",x,y,n)
- system.newTimer(function()
- tfm.exec.removeImage(img,n)
- if pet then
- DP(0,x,y,n)
- for pp=1,#objects do
- if x-35==objects[pp].x and y-55==objects[pp].y then
- if objects[pp].id==cheeseId then
- tfm.exec.giveCheese(n)
- tfm.exec.playerVictory(n)
- for n,p in pairs (tfm.get.room.playerList) do
- tfm.exec.chatMessage(text[n].cheeseplace, n)
- end
- data[n].keys[3].time=0
- cheeseId=math.random(1,#objects)
- a[n]=1
- else
- print("There's No Cheese Here.")
- end
- end
- end
- end
- end,time*1000,false)
- end
- function setLang(n)
- text[n]=lang[tfm.get.room.playerList[n].community] or lang.en
- end
- function Data(n)
- data[n]={time=os.time(),keys={[3]={down=false,time=0}},key=0,food=0,food2=0,lists=0,skills={{false},{false,6,time=os.time()},{false,6,time=os.time()},{false,4,time=os.time()},{false,3,time=os.time()},{true,1}}}
- end
- function DP(id,x,y,n)
- for i=1, 5 do
- tfm.exec.displayParticle(id,x,y,(math.random(30)-15)/5, (math.random(10)-5)/5,0,0,n)
- end
- end
- function DieWon()
- local i=0
- local n
- for pn,p in pairs(tfm.get.room.playerList) do
- if not p.isDead then
- i=i+1
- n=pn
- end
- end
- if i==0 then
- tfm.exec.newGame(maps[math.random(#maps)])
- end
- end
- function eventNewPlayer(n)
- setLang(n)
- if not data[n] then
- Data(n)
- end
- p[n]={right=false, left=false}
- for k=0,100 do
- system.bindKeyboard(n, k, true, true)
- end
- system.bindMouse(n,true, true)
- tfm.exec.chatMessage(text[n].welcome, n)
- tfm.exec.chatMessage(text[n].objective,n)
- end
- table.foreach(tfm.get.room.playerList,eventNewPlayer)
- function eventMouse(n, x, y)
- if data[n].skills[5][1] and data[n].skills[5][2] > 0 and data[n].skills[5].time < os.time()-3000 then
- data[n].skills[5].time=os.time()
- data[n].skills[5][2]=data[n].skills[5][2]-1
- tfm.exec.movePlayer(n, x, y, false, 0, 0,false)
- end
- end
- function eventNewGame()
- alive=0
- tfm.exec.setGameTime(123)
- for n,p in pairs(tfm.get.room.playerList) do
- alive=alive+1
- data[n].skills[2][2]=6
- data[n].skills[3][2]=6
- data[n].skills[4][2]=4
- data[n].skills[5][2]=3
- data[n].skills[6][2]=1
- if data[n].skills[1][1] then
- tfm.exec.giveMeep(n)
- end
- for i=2,5 do
- data[n].skills[i].time=os.time()
- end
- end
- if tfm.get.room.currentMap~="@0" then
- xml=tfm.get.room.xmlMapInfo.xml
- end
- objects = {}
- local i=0
- for ob in string.gmatch(xml, '<D><P .-/></D>') do
- for object in string.gmatch(ob, '<P .-/>') do
- i=i+1
- table.insert(objects,{id=i,x=tonumber(object:match('X="(.-)"')), y=tonumber(object:match('Y="(.-)"'))})
- end
- end
- cheeseId=math.random(1,#objects)
- for i=1,#objects do
- if objects[i].id==cheeseId then
- ui.addTextArea(0,"<p align='center'>Cheese is here","Bodykudo#0000", objects[i].x-50, objects[i].y-30,100,20, nil, nil, 0.7, false)
- end
- end
- end
- function openProfile(n,p)
- ui.addTextArea(1,"<a href='event:close'><b><font color='#926944'><p align='center'>X",n,520,90,15,35,0xFED69A,0x926944,1,true)
- ui.addTextArea(2,"",n,225,112,310,160,0x926944,0x926944,1,true)
- ui.addTextArea(3,"",n,230,117,300,150,0xFED69A,0xFED69A,1,true)
- ui.addTextArea(4,"<b><font size='20' color='#926944'><p align='center'>"..p,n,280,90,200,30,0xFED69A,0x926944,1,true)
- end
- function eventKeyboard(n, k, d, x, y)
- data[n].key=k
- if k==2 then
- p[n].right=true
- p[n].left=false
- elseif k==0 then
- p[n].right=false
- p[n].left=true
- elseif k==80 then
- local id=objects[math.random(#objects)].id
- local x=objects[id].x
- local y=objects[id].y
- ui.timerImage("1622a0ff93a",x-35,y-55,n,true,5)
- elseif k==3 then
- if d then
- data[n].keys[3].down=d
- data[n].keys[3].time=os.time()
- system.bindKeyboard(n, k, false, true)
- else
- data[n].keys[3].down=d
- system.bindKeyboard(n, k, true, true)
- data[n].keys[3].time=0
- end
- elseif k==1 and data[n].skills[3][1] and data[n].skills[3][2] > 0 and data[n].skills[3].time < os.time()-3000 then
- data[n].skills[3].time=os.time()
- tfm.exec.movePlayer(n, 0, 0, false, 0, -100,false)
- for i = 0,15,.25 do
- tfm.exec.displayParticle(({2,11})[((i*4)%2)+1],x+math.sin(i*1.1)*20,y+40+-i*3.5)
- end
- data[n].skills[3][2]=data[n].skills[3][2]-1
- elseif k==32 and data[n].skills[2][1] and data[n].skills[2][2] > 0 and data[n].skills[2].time < os.time()-3000 then
- data[n].skills[2].time=os.time()
- for i = 1,10 do
- tfm.exec.displayParticle(35,x,y,(p[n].righ and 15 or -15),math.random(-3,3))
- end
- tfm.exec.movePlayer(n,0,0,true,p[n].right and 150 or -150,0,false)
- data[n].skills[2][2]=data[n].skills[2][2]-1
- elseif k==79 and data[n].skills[4][1] and data[n].skills[4][2] > 0 and data[n].skills[4].time < os.time()-3000 then
- data[n].skills[4].time=os.time()
- data[n].skills[4][2]=data[n].skills[4][2]-1
- tfm.exec.displayParticle(35,x+(p[n].right and 20 or -20),y,0,0,0,0)
- tfm.exec.movePlayer(n,x+(p[n].right and 65 or -65),y)
- end
- end
- function eventLoop(timePassed,timeLeft)
- if alive == 0 or timeLeft < 1000 then
- tfm.exec.newGame(maps[math.random(#maps)])
- end
- for n,p in pairs (tfm.get.room.playerList) do
- if data[n].time < os.time()-5000 then
- ui.removeTextArea(10000,n)
- end
- a={}
- a[n]=4
- if data[n].key==3 then
- if data[n].keys[3].down then
- if data[n].keys[3].time ~= 0 then
- DP(0,p.x,p.y,n)
- if data[n].keys[3].time < os.time()-3000 then
- for pp=1,#objects do
- if (p.x > objects[pp].x-20 and p.x < objects[pp].x+20) and (p.y > objects[pp].y-20 and p.y < objects[pp].y+20) then
- if objects[pp].id == cheeseId then
- tfm.exec.giveCheese(n)
- tfm.exec.playerVictory(n)
- for n,p in pairs (tfm.get.room.playerList) do
- tfm.exec.chatMessage(text[n].cheeseplace, n)
- end
- data[n].keys[3].time=0
- cheeseId=math.random(1,#objects)
- a[n]=1
- else
- as = math.random(0,100)
- if as < 20 then
- a[n]=3
- aa = math.random(0,2)
- if aa == 1 then
- tfm.exec.displayParticle (10, p.x+30, p.y, 0, 0, 0, 0, n)
- tfm.exec.explosion (p.x+30, p.y, 20, 50, true)
- else
- tfm.exec.displayParticle (10, p.x-30, p.y, 0, 0, 0, 0, n)
- tfm.exec.explosion (p.x-30, p.y, 20, 50, true)
- end
- elseif as > 20 and as < 40 then
- a[n]=3
- ui.addTextArea (10000, "", n, -500, -400, 9999, 9999, 0x1, 0x1, 1, false)
- data[n].time=os.time()
- elseif as > 40 and as < 60 then
- a[n]=3
- local idO = tfm.exec.addShamanObject (math.random(28,29,30,31), p.x, p.y, 0, 0, 0, true)
- table.insert(toDespawn,{os.time(),idO})
- local idO = tfm.exec.addShamanObject (68, p.x, p.y, 0, 0, 0, false)
- table.insert(toDespawn,{os.time(),idO})
- elseif as > 60 and as < 80 then
- a[n]=3
- tfm.exec.movePlayer(n,math.random(50,1550),math.random(50,350),0,0,0,false)
- elseif as > 80 then
- a[n]=3
- tfm.exec.killPlayer(n)
- else
- a[n]=2
- end
- data[n].keys[3].time=0
- end
- else
- data[n].keys[3].time=0
- end
- end
- if a[n]==1 then
- tfm.exec.chatMessage(text[n].cheese, n)
- elseif a[n]==2 then
- tfm.exec.chatMessage(text[n].nocheese, n)
- elseif a[n]==3 then
- tfm.exec.chatMessage(text[n].trap, n)
- else
- tfm.exec.chatMessage(text[n].wrongplace, n)
- end
- end
- end
- else
- data[n].key=0
- data[n].keys[3].time=0
- end
- end
- end
- for i,opp in ipairs(toDespawn) do
- if opp[1] <= os.time()-5000 then
- tfm.exec.removeObject(opp[2])
- table.remove(toDespawn,i)
- end
- end
- end
- eventPlayerDied=DieWon
- function eventPlayerWon(n)
- data[n].food=data[n].food+1
- data[n].food2=data[n].food2+5
- if data[n].food2==5 then
- data[n].lists=data[n].lists+1
- data[n].food2=0
- if data[n].lists < 7 then
- data[n].skills[data[n].lists][1]=true
- end
- end
- DieWon()
- end
- function eventTextAreaCallback(id,n,event)
- if event == "close" then
- for i=1,4 do
- ui.removeTextArea(i, n)
- end
- end
- end
- local c={"proifle","p","lang"}
- function eventChatCommand(n,cmd)
- local c={}
- for i in cmd:gmatch('[^%s]+') do
- table.insert(c,i)
- end
- c[1]=c[1]:lower()
- if (c[1]=="profile" or c[1]=="p") then
- if c[2] then
- if data[c[2]] then
- openProfile(n,c[2])
- end
- else
- openProfile(n,n)
- end
- elseif c[1]=="lang" then
- text[n]=lang[c[2]] or text[n]
- end
- end
- tfm.exec.newGame(maps[math.random(#maps)])
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement