Created
September 12, 2016 19:18
-
-
Save Patosito/3d220c3b0061cc595594c80a367e5ad9 to your computer and use it in GitHub Desktop.
Volar con espacio
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
_space = 32 | |
keyDelay = 200 | |
kts = {} | |
function main() | |
for n in pairs(tfm.get.room.playerList) do | |
eventNewPlayer(n) | |
end | |
end | |
function eventNewPlayer(name) | |
kts[name] = os.time() | |
system.bindKeyboard(name, _space, true) | |
end | |
function eventKeyboard(name, key, down, px, py) | |
if os.time() < kts[name] + keyDelay then return end | |
kts[name] = os.time() | |
if key == _space then | |
tfm.exec.movePlayer(name, 0, 0, true, 0, -40, true) | |
end | |
end | |
main() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment