Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- admin = "Antfield" -- Colocar tu nombre.
- cash = {}
- countdown = 6
- item = {}
- maps = {290361, 127401}
- players = {}
- tfm.exec.disableAutoNewGame()
- tfm.exec.disableAutoShaman()
- tfm.exec.newGame(maps[math.random(#maps)])
- function eventNewGame()
- countdown = 6
- started = false
- tfm.exec.setUIMapName("<J>"..countdown.."...\n")
- end
- function eventNewPlayer(pN)
- item[pN] = 0
- players[pN] = {timestamp = os.time()}
- tfm.exec.bindKeyboard(pN, 32, true, true)
- for n, kC in pairs({40}) do
- tfm.exec.bindKeyboard(pN, kC, true, true)
- end
- system.bindMouse(pN, true)
- if pN == admin then
- cash[pN] = 888888
- else
- cash[pN] = 0
- end
- ui.addTextArea(0, "You have "..cash[pN].." cash!", pN, 638, 28, 155, 20, 0x111111, 0x111111, 1, true)
- ui.addTextArea(1, "<a href = 'event:derollshop'>Tienda! ▼", pN, 9, 28, 100, 20, 0x111111, 0x111111, 1, true)
- end
- function eventLoop(eT, rT)
- if eT >= 6000 and not started then
- started = true
- end
- countdown = countdown - 1
- tfm.exec.setUIMapName("<J>"..countdown.."...\n")
- if countdown <= 0 then
- tfm.exec.setUIMapName("<J>Fight!\n")
- end
- for pN in pairs(tfm.get.room.playerList) do
- cash[pN] = cash[pN] + 1
- ui.updateTextArea(0, "Tienes "..cash[pN].." pesos!", pN, 638, 28, 155, 20, 0x111111, 0x111111, 1, true)
- end
- end
- function eventKeyboard(pN, kC, down, x, y)
- if kC == 32 then
- tfm.exec.movePlayer(pN, 0, 0, true, 0, -50, false)
- elseif kC == 40 and item[pN] == 0 and players[pN].timestamp < os.time() - 750 then
- tfm.exec.addShamanObject(17, x, y, tfm.get.room.playerList[pN].isFacingRight and 90 or 270)
- players[pN].timestamp = os.time()
- elseif kC == 40 and item[pN] == 1 and players[pN].timestamp < os.time() - 750 then
- tfm.exec.addShamanObject(1701, x, y, tfm.get.room.playerList[pN].isFacingRight and 90 or 270)
- players[pN].timestamp = os.time()
- elseif kC == 40 and item[pN] == 2 and players[pN].timestamp < os.time() - 750 then
- tfm.exec.addShamanObject(1703, x, y, tfm.get.room.playerList[pN].isFacingRight and 90 or 270)
- players[pN].timestamp = os.time()
- elseif kC == 40 and item[pN] == 3 and players[pN].timestamp < os.time() - 750 then
- tfm.exec.addShamanObject(1702, x, y, tfm.get.room.playerList[pN].isFacingRight and 90 or 270)
- players[pN].timestamp = os.time()
- elseif kC == 40 and item[pN] == 4 and players[pN].timestamp < os.time() - 750 then
- tfm.exec.addShamanObject(1704, x, y, tfm.get.room.playerList[pN].isFacingRight and 90 or 270)
- players[pN].timestamp = os.time()
- elseif kC == 40 and item[pN] == 5 and players[pN].timestamp < os.time() - 750 then
- tfm.exec.addShamanObject(1705, x, y, tfm.get.room.playerList[pN].isFacingRight and 90 or 270)
- players[pN].timestamp = os.time()
- elseif kC == 40 and item[pN] == 6 and players[pN].timestamp < os.time() - 750 then
- tfm.exec.addShamanObject(1706, x, y, tfm.get.room.playerList[pN].isFacingRight and 90 or 270)
- players[pN].timestamp = os.time()
- end
- end
- function eventPlayerDied(pN)
- local aM = 0
- local pN2
- for n, p in pairs(tfm.get.room.playerList) do
- if not p.isDead then
- aM = aM + 1
- pN2 = n
- end
- end
- if aM == 1 then
- tfm.exec.giveCheese(pN2)
- tfm.exec.playerVictory(pN2)
- tfm.exec.setGameTime(5)
- tfm.exec.newGame(maps[math.random(#maps)])
- end
- end
- function eventTextAreaCallback(id, pN, answer)
- if answer == "derollshop" then
- ui.addTextArea(1, "<a href = 'event:rollshop'>Tienda! ▲</a>\n-> <a href = 'event:glassed'>Cañón de vidrio - 250 coins</a>\n-> <a href = 'event:ornament'>Cañón navideño - 250 coins</a>\n-> <a href = 'event:lollipop'>Cañon de dulce - 300 coins</a>\n-> <a href = 'event:angel'>Cañon de angel - 350 coins</a>\n-> <a href = 'event:apple'>Cañon de manzana - 350 coins</a>\n-> <a href = 'event:watermelon'>Cañón de sandía - 500 coins</a>", pN, 9, 27, 205, 100, 0x111111, 0x111111, 1, true)
- elseif answer == "rollshop" then
- ui.addTextArea(1, "<a href = 'event:derollshop'>Shop! ▼", pN, 9, 28, 100, 20, 0x111111, 0x111111, 1, true)
- elseif answer == "glassed" then
- if cash[pN] >= 250 then
- item[pN] = 1
- cash[pN] = cash[pN] - 250
- ui.updateTextArea(0, "You have "..cash[pN].." cash!", pN, 638, 28, 155, 20, 0x111111, 0x111111, 1, true)
- end
- elseif answer == "ornament" then
- if cash[pN] >= 250 then
- item[pN] = 2
- cash[pN] = cash[pN] - 250
- ui.updateTextArea(0, "You have "..cash[pN].." cash!", pN, 638, 28, 155, 20, 0x111111, 0x111111, 1, true)
- end
- elseif answer == "lollipop" then
- if cash[pN] >= 300 then
- item[pN] = 3
- cash[pN] = cash[pN] - 300
- ui.updateTextArea(0, "You have "..cash[pN].." cash!", pN, 638, 28, 155, 20, 0x111111, 0x111111, 1, true)
- end
- elseif answer == "angel" then
- if cash[pN] >= 350 then
- item[pN] = 4
- cash[pN] = cash[pN] - 350
- ui.updateTextArea(0, "You have "..cash[pN].." cash!", pN, 638, 28, 155, 20, 0x111111, 0x111111, 1, true)
- end
- elseif answer == "apple" then
- if cash[pN] >= 350 then
- item[pN] = 5
- cash[pN] = cash[pN] - 350
- ui.updateTextArea(0, "You have "..cash[pN].." cash!", pN, 638, 28, 155, 20, 0x111111, 0x111111, 1, true)
- end
- elseif answer == "watermelon" then
- if cash[pN] >= 500 then
- item[pN] = 6
- cash[pN] = cash[pN] - 500
- ui.updateTextArea(0, "You have "..cash[pN].." cash!", pN, 638, 28, 155, 20, 0x111111, 0x111111, 1, true)
- end
- end
- end
- for pN in pairs(tfm.get.room.playerList) do
- eventNewPlayer(pN)
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement