Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --[[ #racingsprit [v1.0] codé pour Nahtnam
- Merci de ne pas plagier ce code.
- ... Cheese *-*
- ]]--
- esp=32
- bas=40
- h=72
- temps = 120
- info = {}
- mapList = { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30 }
- function init()
- config()
- for name in pairs(tfm.get.room.playerList) do
- eventNewPlayer(name)
- end
- newGame()
- end
- function config()
- tfm.exec.disableAutoNewGame (true)
- tfm.exec.disableAutoShaman (true)
- tfm.exec.disableAutoTimeLeft (true)
- tfm.exec.disableAutoScore (true)
- end
- function newGame()
- tfm.exec.newGame (mapList[math.random(#mapList)])
- end
- function eventNewGame ()
- vivantS = 0
- tfm.exec.setGameTime (temps, true)
- for name in pairs(info) do
- info[name].vie, info[name].froRam, info[name].vivant = 3, 0, true
- vivantS = vivantS+1
- end
- end
- function eventPlayerWon (name)
- info[name].froRam = info[name].froRam + 1
- if info[name].froRam == 5 then
- tfm.exec.setPlayerScore (name, 5, true)
- elseif info[name].froRam > 5 then
- tfm.exec.setPlayerScore (name, 1, true)
- end
- if info[name].vivant then
- tfm.exec.respawnPlayer (name)
- end
- end
- function eventPlayerDied (name)
- info[name].vie = info[name].vie - 1
- if info[name].vie > 0 then
- tfm.exec.respawnPlayer (name)
- else
- vivantS = vivantS-1
- info[name].vivant = false
- if (vivantS==2) then
- tfm.exec.setGameTime (10, false)
- end
- end
- if vivantS==0 then
- newGame()
- end
- end
- function eventNewPlayer (name)
- tfm.exec.bindKeyboard (name, h, true, true)
- tfm.exec.bindKeyboard (name, esp, true, true)
- tfm.exec.bindKeyboard (name, bas, true, true)
- tfm.exec.setPlayerScore (name, 0, false)
- info[name] = { x=0, y=15, vie=0, froRam=0, vivant=false }
- end
- function eventPlayerLeft (name)
- info[name] = nil
- end
- function eventKeyboard (name, key, down, x, y)
- if (info[name].vivant) and ((key==esp) or (key==bas)) then
- tfm.exec.addShamanObject (24, x+(info[name].x * ((tfm.get.room.playerList[name].isFacingRight and 1) or -1)), y+info[name].y, 0, 0, 0, false)
- elseif key==h then
- ui.addPopup(1, 0, "Utilisez les touches espace et bas pour vous propulser à l'aide d'un esprit et rapporter cinq fois ou plus le fromage au trou.", name, 250, 180, 300, true)
- end
- end
- function eventChatCommand (name, command)
- local M = {}
- for k in string.gmatch(command, "[^%s]+") do
- table.insert(M, k)
- end
- if M[1]=="mort" then
- tfm.exec.killPlayer(name)
- elseif M[1]=="offset" then
- M[2], M[3] = tonumber(M[2]) or info[name].x, tonumber(M[3]) or info[name].y
- info[name].x, info[name].y = ((math.abs(M[2])<50) and M[2]) or info[name].x, ((math.abs(M[3])<50) and M[3]) or info[name].y
- else
- ui.addPopup(2, 0, "Je ne connais pas cette commande, tapez sur H pour afficher l'aide", name, 300, 180, 200, true)
- end
- end
- function eventLoop (past, left)
- if left < 0 then
- newGame()
- end
- end
- init()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement