Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --DARKROOM--
- tfm.exec.disableAutoScore(true)
- tfm.exec.disableAutoShaman(true)
- tfm.exec.disableAfkDeath(true)
- tfm.exec.disableAutoNewGame(true)
- mapcr={"Aviener","Kaysha","Ilyasport"}
- admins={"Aviener"}
- maplist={"@1257258", "@6459786", "@4043664"}
- maps=maplist[math.random(#maplist)]
- imagelist={"urO90YM.png", "urO90YM.png", "lxPoKiA.png", "9JYR0yi.png", "4IOIp8K.png"}
- skin=imagelist[math.random(#imagelist)]
- function xmlToobj(xmlS)
- local obj={}
- local i={}
- for w in string.gmatch(xmlS, "<P.-T.->") do
- local tmps=string.sub(w, string.find(w, 'X="[-]?%d+"'))
- xO=string.sub(tmps,string.find(tmps,"[-]?%d+"))
- tmps=string.sub(w, string.find(w, 'Y="[-]?%d+"'))
- yO=string.sub(tmps,string.find(tmps,"[-]?%d+"))
- idO=string.gsub(string.sub(w, string.find(w, 'T="%d+"')),"%D","")
- table.insert(obj,{x=tonumber(xO);y=tonumber(yO);id=tonumber(idO)})
- end
- return obj
- end
- function eventNewGame()
- if tfm.get.room.xmlMapInfo.xml then
- local myVar = xmlToobj(tfm.get.room.xmlMapInfo.xml);
- local tmpO=myVar[math.random(#myVar)]
- tfm.exec.addShamanObject (27, tmpO.x, tmpO.y-10, 0, 0, 0, ghost)
- tfm.exec.addShamanObject (26, 830, 334, 0, 0, 0, false)
- ui.removeTextArea (1, playerName)
- end
- end
- --ChatCommands
- function eventChatCommand(playername, cmd)
- if cmd == "help" then
- print("<BV>Point of game</BV><N>: Find <BV> the hole</BV> (exit from room)\
- <N>Type <j>!cont</j> for contacts\
- <BV>Original idea</BV><N>: Defoster\
- <BV>Game made by</BV><N>: Aviener")
- else
- if cmd== "cont" then
- print("<BV>Admin<N>: Aviener\
- <BV>Map Crew<N>: "..table.concat(mapcr, ", "))
- end
- end
- end
- --Game
- tfm.exec.newGame(maplist[math.random(#maplist)])
- function eventNewPlayer(playerName)
- print("<BV>"..playerName.."</BV><N>, hello! Welcome to <BV>#darkroom<BV>!<N> Try to find hole. Type <J>help<J> <N>(with exclamation mark) for more information!<CH>")
- end
- function eventPlayerWon(playerName)
- print("<CH>"..playerName.."</CH><N> won the <J>game!<G>")
- tfm.exec.newGame(maplist[math.random(#maplist)])
- end
- function eventLoop(t1,t2)
- if t2<=0 then
- maps=maplist[math.random(#maplist)]
- tfm.exec.newGame(maplist[math.random(#maplist)])
- end
- end
- --Give Skin to player
- function eventNewGame()
- for name,player in pairs(tfm.get.room.playerList) do
- tfm.exec.addImage("skin=imagelist[math.random(#imagelist)]", "playerName", 0, 0, playerName)
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement