Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- mapList = {"@7577773,@0" }
- round = 0;
- alive = 0;
- rank = 1;
- function main()
- tfm.exec.disableAllShamanSkills (true)
- tfm.exec.disableAutoNewGame(true)
- tfm.exec.disableAutoScore(true)
- for name in pairs(tfm.get.room.playerList) do
- tfm.exec.setPlayerScore(name, 0)
- end
- launchGame()
- end
- function launchGame()
- tfm.exec.setGameTime(1)
- tfm.exec.newGame(mapList[math.random(#mapList)])
- end
- function eventChatCommand(name, command)
- if command=='mort' then tfm.exec.killPlayer(name) end
- end
- function eventNewGame()
- tfm.exec.setGameTime(120)
- rank = 1;
- alive = 0;
- for name in pairs(tfm.get.room.playerList) do alive = alive+1 end
- round=round+1
- if round > 10 then
- for name in pairs(tfm.get.room.playerList) do
- tfm.exec.setPlayerScore(name, 0)
- end
- round = 1
- end
- tfm.exec.setUIShamanName("<N><font color='#00C8E2'>Round number : <CH>"..round.."/10")
- end
- function eventLoop(past, left)
- if left<0 then tfm.exec.newGame(mapList[math.random(#mapList)]) end
- end
- function eventPlayerLeft(name)
- alive = alive-1
- if alive == 0 then tfm.exec.setGameTime(0) end
- end
- function eventPlayerWon(name)
- tfm.exec.setPlayerScore(name, rank==1 and 4 or rank==2 and 3 or rank==3 and 2 or 1, true)
- rank = rank+1
- alive = alive-1
- if alive == 0 then tfm.exec.setGameTime(0) end
- end
- main()
- function eventNewGame()
- shaman=nil
- for name,player in pairs(tfm.get.room.playerList) do
- if(tfm.get.room.playerList[name].isShaman) then
- shaman=name
- print(shaman.." just stole the cheese! CATCH HER!")
- tfm.exec.giveCheese(shaman)
- end
- end
- if(shaman==nil) then
- print('No shaman found!')
- end
- end
- function eventLoop(ct,cr)
- if(shaman~=nil) and not tfm.get.room.playerList[shaman].isDead then
- local shamanx=tfm.get.room.playerList[shaman].x
- local shamany=tfm.get.room.playerList[shaman].y
- for name,player in pairs(tfm.get.room.playerList) do
- if not tfm.get.room.playerList[name].isShaman then
- x=tfm.get.room.playerList[name].x
- y=tfm.get.room.playerList[name].y
- if x>shamanx-30 and x<shamanx+30 and y>shamany-30 and y<shamany+30 then
- tfm.exec.giveCheese(name)
- end
- end
- end
- end
- end
- local data = {}
- function eventNewPlayer(name)
- if not data[name] then
- data[name]={}
- data[name].points = 0
- data[name].morts = 0
- end
- end
- for i, command in ipairs ({"ملف","p","stats","profile"}) do
- system.disableChatCommandDisplay(command,true)
- end
- for name, player in pairs(tfm.get.room.playerList) do
- eventNewPlayer(name)
- end
- function eventPlayerDied(name)
- alive = alive-1
- if alive == 0 then tfm.exec.setGameTime(0) end
- data[name].morts = data[name].morts+1
- print(name.." لقد مات اللاعب "..data[name].morts.." موت")
- end
- function eventPlayerWon(name)
- data[name].points = data[name].points+1
- print(name.." لقد فاز اللاعب "..data[name].points.." نقاط")
- end
- function eventTextAreaCallback(id,name,cb)
- if cb=='cperfil' then
- removePerfil(name)
- end
- end
- function eventChatCommand(name,command)
- local args={}
- for word in command:gmatch("[^%s]+") do
- table.insert(args, word)
- end
- if args[1] == "" or args[1] == "" or args[1] == "p" or args[1]=="profile" and data[capitalize(args[2])] then
- getPerfil(name, name)
- end
- end
- function getPerfil(n,to)
- ui.addTextArea(2,"<br><bl><font size='13' color='#00F5F5'>عدد مرات الفوز: <g>"..data[n].points.."<br><bl><font color='#00F5F5'>عدد مرات الموت: <g>"..data[n].morts.."",to,300,190,260,nil,0x302d2d,0xff0000,nil,true)
- ui.addTextArea(3,"<p align='center'><font size='17'><v>profile: <n>"..n.."",to,300,170,260,nil,0x302d2d,0xbd0000,nil,true)
- ui.addTextArea(4,"",to,543,170,13,13,0xeb0000,0x00c9b5,nil,true)
- ui.addTextArea(5,"<font size='15' color='#1C3C41'><b><a href='event:cperfil'><font color='#00F5F5'>C",to,542,166,nil,nil,"0","0",nil,true)
- end
- function removePerfil(name)
- ui.removeTextArea(2,name)
- ui.removeTextArea(3,name)
- ui.removeTextArea(4,name)
- ui.removeTextArea(5,name)
- end
- function capitalize(word)
- if word then
- if word:find("+") then
- return string.upper(word:sub(1,2)) .. string.lower (word:sub(3));
- else
- return string.upper(word:sub(1,1)) .. string.lower (word:sub(2));
- end
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment