Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- countdown = 15
- tfm.exec.setRoomMaxPlayers(6)
- tfm.exec.disableAutoShaman(true)
- data={}
- r2={}
- mice={}
- canRank={}
- function r2:rank(name)
- scores = {}
- rank = true
- txt1=""
- txt2=""
- table.foreach(data, function(k, v) table.insert(scores,{name=k,score=v.score}) end)
- table.sort(scores, function(a, b) return a.score>b.score end)
- table.foreachi(scores, function(k, v) if k <= 10 then txt1 = ""..txt1.."<font color='#724C31'><br><V>"..k..") "..v.name..""
- txt2 = ""..txt2.."<font color='#724C31'><br><V>"..v.score.."" end end)
- end
- function openRank(n)
- rank = false
- canRank[n]=true
- ui.addTextArea(-4, "<font face='Comic Sans MS'><font size='14'><b><V><p align='center'>Room Leaderboard<br><J>Winning! "..txt1.."", n, 21, 61, 250, 283, 0x000001, 0xFFFFFF, 0.2, true)
- ui.addTextArea(-6, "<font face='Comic Sans MS'><p align='center'><font size='14'><p align='center'><b><V>Score<br>"..txt2.."", n, 300, 61, 122, 283, 0x000001, 0xFFFFFF, 0.2, true)
- ui.addTextArea(-7, "", n, 20, 367, 254, 23, 0x123e54, 0x123e54, 0.6, true)
- ui.addTextArea(-8, "<p align='center'><b><N><a href='event:close'>Close", n, 20, 369, 250, 19, 0x073247, 0x2c555c, 0.2, true)
- end
- function closeRank(n)
- for areas, k in pairs({"-1","-2","-3","-4","-5","-6","-7","-8"}) do
- ui.removeTextArea(k, n)
- end
- rank = false
- canRank[n]=false
- end
- function eventLoop(g,l)
- rank = false
- canRank[n]=true
- ui.addTextArea(-4, "<p align='center'><font size='11'><b><J>Room Leaderboard<br>"..txt1.."", n, 91, 61, 100, 283, 0x073247, 0x073247, 0.6, true)
- end
- for n,player in pairs(tfm.get.room.playerList) do
- tfm.exec.bindKeyboard(n,"0",true,true)
- tfm.exec.bindKeyboard(n,"1",true,true)
- tfm.exec.bindKeyboard(n,"2",true,true)
- tfm.exec.bindKeyboard(n,"3",true,true)
- end
- tfm.exec.newGame('<C><P DS="m;55,315,175,315,295,315,415,315,535,315" defilante="0,0,30,1" L="4800" /><Z><S><S X="1500" o="324650" L="3000" Y="416" H="69" P="0,0,0.1,0.2,0,0,0,0" T="12" /><S X="3900" o="324650" L="1800" Y="416" H="69" P="0,0,0.3,0.2,0,0,0,0" T="12" /><S X="2" L="22" Y="295" H="241" P="0,0,0,0.2,0,0,0,0" T="1" /><S X="4798" L="32" Y="286" H="250" P="0,0,0,0.2,0,0,0,0" T="1" /></S><D><DS X="400" Y="344" /></D><O /></Z></C>')
- tfm.exec.disableAutoNewGame(true)
- function eventNewPlayer(n)
- tfm.exec.chatMessage("<ROSE>Welcome <J>"..n.."<ROSE>!",n)
- mice[n] = {score = 0,rank = r2.rank}
- data[n]={color=math.random(0xFFFFFF),x=400,y=200,score=0,wins=0,award=""}
- ui.addTextArea(-78," ",n,-500,-500,9000,9000,0xFFFFFF,0xFFFFFF,1,false)
- mice[n].rank(n)
- openRank(n)
- tfm.exec.bindKeyboard(n,"0",true,true)
- tfm.exec.bindKeyboard(n,"1",true,true)
- tfm.exec.bindKeyboard(n,"2",true,true)
- tfm.exec.bindKeyboard(n,"3",true,true)
- ui.addTextArea(-20, "<p align='center'><b><V><a href='event:lb'>Room Leaderboard", n, 700, 369, 90, 39, 0x073247, 0x2c555c, 0.2, true)
- ui.addTextArea(-21, "<p align='center'><b><V><a href='event:color'>Change Color", n, 600, 369, 90, 39, 0x073247, 0x2c555c, 0.2, true)
- ui.addTextArea(-22, "<p align='center'><b><V><a href='event:help'>Help", n, 500, 369, 90, 39, 0x073247, 0x2c555c, 0.2, true)
- tfm.exec.respawnPlayer(n)
- end
- table.foreach(tfm.get.room.playerList,eventNewPlayer)
- function eventTextAreaCallback(ids,n,cb)
- if cb=="close" then
- closeRank(n)
- ui.removeTextArea(-32,n)
- ui.removeTextArea(-33,n)
- ui.removeTextArea(-34,n)
- ui.removeTextArea(-35,n)
- ui.removeTextArea(-36,n)
- ui.removeTextArea(-37,n)
- ui.removeTextArea(-38,n)
- elseif cb=="lb" then
- mice[n].rank(n)
- openRank(n)
- elseif cb=="color" then
- ui.showColorPicker(0,n,data[n].color,"Choose your color!")
- elseif cb=="help" then
- ui.addTextArea(-1, "", n, 220, 45, 360, 313, 0x123e54, 0x123e54, 1, true)
- ui.addTextArea(-32, "", n, 222, 48, 356, 307, 0x042636, 0x042636, 1, true)
- ui.addTextArea(-33, "", n, 229, 59, 191, 287, 0x2c555c, 0x2c555c, 1, true)
- ui.addTextArea(-34, "<p align='center'><font size='25'><i>#DrawLand</i></b><VP><font size='13'><br><br>In #DrawLand your goal is to try to get to 500 points on the leaderboard, you can get those points from placing more art on the the map, or you can also draw art for just the fun of it. To move you just use normal controls. (WASD or right, left, down, and up keys). The more wins you get, the more prizes you get, explore that for yourself by getting more wins!", n, 231, 61, 187, 283, 0x073247, 0x073247, 1, true)
- ui.addTextArea(-35, "", n, 481, 59, 86, 287, 0x2c555c, 0x2c555c, 1, true)
- ui.addTextArea(-36, "<p align='center'><N><br><br><br><br><br><font size='10'>Made by Fuzzyfirsdog.<br><br>Credits to Bolodefchoco and Bodykudo for extra coding.", n, 483, 61, 82, 283, 0x073247, 0x073247, 1, true)
- ui.addTextArea(-37, "", n, 348, 367, 104, 23, 0x123e54, 0x123e54, 1, true)
- ui.addTextArea(-38, "<p align='center'><b><R><a href='event:close'>Close", n, 350, 369, 100, 19, 0x073247, 0x2c555c, 1, true)
- end
- end
- id=0
- function eventKeyboard(name,key,down,xPos,yPos)
- id = id + 1
- if data[name].score == 500 then
- data[name].x = 400
- data[name].y = 200
- countdown = 0
- data[name].score = 0
- data[name].wins = data[name].wins + 1
- tfm.exec.chatMessage("<ROSE>"..name.." has earned 1 win by getting 500 points and now has a total of <J>"..data[name].wins.."<ROSE> wins!")
- tfm.exec.chatMessage("<br><VP>New Round Starting in 7 seconds!")
- local data = 0
- elseif key==0 and down then
- tfm.exec.setPlayerScore(name,data[name].score)
- data[name].x = data[name].x - 22
- ui.addTextArea(id,data[name].award,nil,data[name].x,data[name].y,20,20,data[name].color,data[name].color,1,false)
- ui.addTextArea(names[math.random(#names)]," <font color='#000001'><font size='10'>"..name.." Wins: "..data[name].wins,nil,data[name].x - 22,data[name].y - 30,200,20,0xFF7700,0xFF7700,0,false)
- data[name].score = data[name].score + 2
- mice[name].score = mice[name].score + 2
- elseif key==2 and down then
- tfm.exec.setPlayerScore(name,data[name].score)
- data[name].score = data[name].score + 2
- mice[name].score = mice[name].score + 2
- ui.addTextArea(names[math.random(#names)]," <font color='#000001'><font size='10'>"..name.." Wins: "..data[name].wins,nil,data[name].x - 22,data[name].y - 30,200,20,data[name].color,data[name].color,0,false)
- data[name].x = data[name].x + 22
- ui.addTextArea(id,data[name].award,nil,data[name].x,data[name].y,20,20,data[name].color,data[name].color,1,false)
- elseif key==1 and down then
- tfm.exec.setPlayerScore(name,data[name].score)
- data[name].score = data[name].score + 2
- mice[name].score = mice[name].score + 2
- ui.addTextArea(names[math.random(#names)]," <font color='#000001'><font size='10'>"..name.." Wins: "..data[name].wins,nil,data[name].x - 22,data[name].y - 30,200,20,data[name].color,data[name].color,0,false)
- data[name].y = data[name].y - 22
- ui.addTextArea(id,data[name].award,nil,data[name].x,data[name].y,20,20,data[name].color,data[name].color,1,false)
- elseif key==3 and down then
- data[name].score = data[name].score + 2
- mice[name].score = mice[name].score + 2
- data[name].y = data[name].y + 22
- ui.addTextArea(id,data[name].award,nil,data[name].x,data[name].y,20,20,data[name].color,data[name].color,1,false)
- ui.addTextArea(names[math.random(#names)]," <font color='#000001'><font size='10'>"..name.." Wins: "..data[name].wins,nil,data[name].x - 22,data[name].y - 30,200,20,data[name].color,data[name].color,0,false)
- tfm.exec.setPlayerScore(name,data[name].score)
- end
- end
- names={"hi xD"}
- function eventColorPicked(id,n,col)
- if col~=1 then
- data[n].color=col
- end
- end
- maps={'<C><P DS="m;55,315,175,315,295,315,415,315,535,315" defilante="0,0,30,1" L="4800" /><Z><S><S X="1500" o="324650" L="3000" Y="416" H="69" P="0,0,0.1,0.2,0,0,0,0" T="12" /><S X="3900" o="324650" L="1800" Y="416" H="69" P="0,0,0.3,0.2,0,0,0,0" T="12" /><S X="2" L="22" Y="295" H="241" P="0,0,0,0.2,0,0,0,0" T="1" /><S X="4798" L="32" Y="286" H="250" P="0,0,0,0.2,0,0,0,0" T="1" /></S><D><DS X="400" Y="344" /></D><O /></Z></C>'}
- function eventLoop(lx,dx)
- countdown = countdown + 0.5
- tfm.exec.setUIMapName("<font color='#009799'>Draw Land!")
- for n in next,tfm.get.room.playerList do
- if canRank[n] then
- mice[n].rank(n)
- openRank(n)
- if countdown == 7 then
- tfm.exec.newGame(maps[math.random(#maps)])
- tfm.exec.setGameTime("7")
- if data[n].wins == 5 then
- data[n].award = "<font size='17'><J>♣♣"
- tfm.exec.chatMessage(n.." has earned a new skin!")
- elseif data[n].wins == 10 then
- data[n].award = "<font size='17'><J>☪"
- tfm.exec.chatMessage(n.." has earned a new skin!")
- elseif data[n].wins == 15 then
- data[n].award = "<font size='17'><T>☯"
- tfm.exec.chatMessage(n.." has earned a new skin!")
- elseif data[n].wins == 25 then
- data[n].award = "<font size='17'><R>☢"
- tfm.exec.chatMessage(n.." has earned a new skin!")
- elseif data[n].wins == 40 then
- data[n].award = "<font size='17'><VP>◘<J>☼"
- tfm.exec.chatMessage(n.." has earned a new skin!")
- elseif data[n].wins == 70 then
- data[n].award = "<font size='17'><N>♚"
- tfm.exec.chatMessage(n.." has earned a new skin!")
- elseif data[n].wins == 100 then
- data[n].award = "<font size='15'><J>♛"
- tfm.exec.chatMessage(n.." has earned a new skin!")
- elseif dx<=0 then
- tfm.exec.newGame(maps[math.random(#maps)])
- ui.addTextArea(-80," ",nil,-500,-500,9000,9000,0xFFFFFF,0xFFFFFF,1,false)
- end
- end
- end
- end
- end
- ui.addTextArea(-20, "<p align='center'><b><V><a href='event:lb'>Room Leaderboard", n, 700, 369, 90, 39, 0x073247, 0x2c555c, 0.2, true)
- ui.addTextArea(-21, "<p align='center'><b><V><a href='event:color'>Change Color", n, 600, 369, 90, 39, 0x073247, 0x2c555c, 0.2, true)
- ui.addTextArea(-22, "<p align='center'><b><V><a href='event:help'>Help", n, 500, 369, 90, 39, 0x073247, 0x2c555c, 0.2, true)
- function eventPlayerDied(m)
- tfm.exec.respawnPlayer(m)
- end
- ui.addTextArea(-79," ",nil,-500,-500,9000,9000,0xFFFFFF,0xFFFFFF,1,false)
- eventNewGame = function()
- ui.addTextArea(-77," ",nil,-500,-500,9000,9000,0xFFFFFF,0xFFFFFF,1,false)
- for ic in next,toRemove do
- for n,player in pairs(tfm.get.room.playerList) do
- data[n].x = 400
- data[n].y = 200
- ui.removeTextArea(ic)
- data[n].score = 0
- end
- end
- end
- toRemove = {}
- do
- local addTextArea = ui.addTextArea
- ui.addTextArea = function(id,...)
- toRemove[id] = true
- addTextArea(id,...)
- end
- end
- tfm.exec.disableAfkDeath(true)
- for c,player in pairs(tfm.get.room.playerList) do
- mice[c].rank(c)
- openRank(c)
- end
Advertisement
Add Comment
Please, Sign In to add comment