Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --Creator: Bolodefchoco
- --Made in: 08/02/2018
- --Last update: 08/02/2018
- --[[ Notes:
- Does:
- Carrega mapas de uma lista
- Keys:
- Z --> Próximo mapa
- X --> Mapa anterior
- C --> Recarregar mapa
- Shift + Click --> Teleport
- Commands:
- !s Nickname --> Atribui Shaman
- ]]--
- local admin = "Bolodefchoco" -- Change "Bolodefchoco", put your nickname instead
- local mapCodes = [[
- -- Maps go here
- ]]
- local maps = {}
- for code in mapCodes:gmatch("@(%d+)") do
- maps[#maps + 1] = tonumber(code) or 0
- end
- for k, v in next, {string.byte("ZXC\16", 1, 4)} do
- system.bindKeyboard(admin, v, true, true)
- end
- system.bindKeyboard(admin, 16, false, true)
- system.bindMouse(admin, true)
- local currentRound = 1
- local round = function(x)
- return x > #maps and #maps or x < 1 and 1 or x
- end
- local canChange = true
- eventNewGame = function()
- canChange = true
- end
- local holdShift = false
- eventKeyboard = function(n, k, d)
- if k == 16 then -- shift
- holdShift = d
- else
- if canChange then
- local oldRound = currentRound
- if k == string.byte("Z") then
- currentRound = round(currentRound + 1)
- elseif k == string.byte("X") then
- currentRound = round(currentRound - 1)
- end
- if k == string.byte("C") or oldRound ~= currentRound then
- canChange = false
- end
- end
- end
- end
- eventLoop = function()
- if not canChange then
- tfm.exec.newGame(maps[currentRound])
- end
- end
- eventMouse = function(n, x, y)
- if holdShift then
- tfm.exec.movePlayer(n, x, y)
- end
- end
- eventChatCommand = function(n, c)
- if n == admin and c:sub(1,1) == "s" then
- local name = c:sub(3)
- if tfm.get.room.playerList[name] then
- tfm.exec.setShaman(name)
- end
- end
- end
- eventPlayerDied = tfm.exec.respawnPlayer
- eventPlayerWon = tfm.exec.respawnPlayer
- tfm.exec.disableAutoNewGame()
- tfm.exec.disableAutoShaman()
- tfm.exec.disableAfkDeath()
- tfm.exec.newGame(maps[currentRound])
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement