Lua Snippets |
0 | ||
function eventNewPlayer(name) tfm.exec.bindKeyboard(name,32,true,true) end for name,player in pairs(tfm.get.room.playerList) do eventNewPlayer(name) end function eventKeyboard(name,key,down,x,y) if key==32 then tfm.exec.movePlayer(name,0,0,true,0,-50,false) end end fly = true function eventNewGame() for p in pairs(tfm.get.room.playerList) do tfm.exec.bindKeyboard(p, 32, true, true) end end function eventKeyboard(p, key) if fly and key == 32 then tfm.exec.movePlayer(p, 0, 0, true, 0, -50, true) end end function eventChatCommand(p, c) if c == "fly" then fly = not fly end end ____________________________________________ !fly = don't fly =D |
![]() ![]() « Consul » 1380483420000
| 0 | ||
[•] Init Error : [string "transformice.lua"]:15: 'end' expected (to close 'if' at line 2) This error message doesn't mean you just need to add an "end" on the last line of your code, it tells you exactly what line you need to close. In your code, for example... a dit : You need to end both eventChatCommand and the "if command==" line. a dit : Although of course you never specified anything for it to do. |
![]() ![]() « Citoyen » 1380483540000
| 0 | ||
Shamousey a dit : No error, and fly don't work :/ |
![]() ![]() « Consul » 1380483660000
| 0 | ||
Manacer a dit : I only quoted part of the code to show what was wrong, not the entire thing. |
![]() « Citoyen » 1380484860000
| 0 | ||
Where and error? a dit : . |
0 | ||
Byenamo a dit : Might help if you also post the error message. |
![]() ![]() « Citoyen » 1380485460000
| 0 | ||
Thank ! |
0 | ||
Please shaman, a command (« ! ») for cheese. a dit : The "admins ={"NAME"}...only for me. a dit : |
![]() « Citoyen » 1380485580000
| 0 | ||
Jordynl a dit : not catch the fly |
![]() ![]() « Citoyen » 1380485880000
| 0 | ||
I help with a problem, I can not make maps with put category P1 :[ |
![]() ![]() « Citoyen » 1380486000000
| 0 | ||
Tinittee a dit : Mort only works for regular players. You can add more admins if you want. a dit : This should work out for you. !1 only works for you or me. While others cant do !1 they can do !mort. ( p means player and c means command) |
0 | ||
!cheese? I can't :( ctrl +c and ctrl + v, but...fail |
![]() ![]() « Citoyen » 1380486360000
| 0 | ||
Tinittee a dit : Do !1 instead of !cheese. |
![]() ![]() « Citoyen » 1380486600000
| 0 | ||
Adelkiii a dit : help please |
![]() ![]() « Citoyen » 1380486900000
| 0 | ||
Adelkiii a dit : this should help you VVV a dit : Replace P with #. #1 = P1, #3 = P3 etc,. |
0 | ||
How can I have more than one key? |
![]() ![]() « Consul » 1380487920000
| 0 | ||
Bind multiple keys, and have multiple if statements depending on different keys. a dit : |
0 | ||
can give a complete example? |
![]() ![]() « Consul » 1380488040000
| 0 | ||
I just did. |
![]() ![]() « Citoyen » 1380488280000
| 0 | ||
Shamousey a dit : Shamousey please can you give the code utility (help 2 page) |