| |
| « Consul » 1516293780000
| 0 | ||
| How to make text area only show content for players in mod = {} table? (what's the syntax? [mod] or what?) |
| « Citoyen » 1516299600000
| 0 | ||
Marciskris a dit : Code Lua 1 2 3 4 mod = { Marciskris = true } |
| « Sénateur » 1516299900000
| 0 | ||
Marciskris a dit : You can use the for index, value in next, table_name do statement which works like the foreach in C#, Java, etc... Note that pairs(table) returns next, table, nil, and you can also use ipairs(table) to iterate only numeric indexes. You can also concatenate all the items of the table by using the function table.concat(table_name, separator), e.g., table.concat(mod, ", ") Dernière modification le 1516300020000 |
| « Citoyen » 1516381020000
| 0 | ||
| is there a function I can create to get the mouse position ( x and y) ? (that is better than the tfm.get.room.playerList[name].x) because tfm.get.room.playerList[name].x or y only update info every 2 seconds. |
| « Sénateur » 1516383960000
| 0 | ||
Heniyengui a dit : Unfortunately the source of the coordinates are these indexes, but you can use this trick: Code Lua 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 eventNewPlayer = function(player) |
| « Citoyen » 1516385400000
| 0 | ||
Bolodefchoco a dit : Are you sure this works? I think you can't bind the key when it's hold or released, I mean, for example, in your script all the keys will be bind when down = false, I am not sure tho. Thank you anyway, I will try it :) |
| « Sénateur » 1516386600000
| 0 | ||
Heniyengui a dit : system.bindKeyboard(name, key, boolean released, boolean active) The second loop binds it both pressed and released, so eventKeyboard is triggered during a press and a release |
| « Citoyen » 1516473000000
| 0 | ||
| how would i make it so it would do this If mice > 4 [module script here] else If mice < 5 set map [map here] until mice > 4 Dernière modification le 1516473060000 |
| « Sénateur » 1516473420000
| 0 | ||
Borntolol a dit : So, you want to make a 'wait' until enough mice, or kinda.. Well, you'll need to use a loop! Code Lua 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 countMice = function() Dernière modification le 1516473480000 |
| « Citoyen » 1516473720000
| 0 | ||
| thanks :D, Ill probably come back with another request later xD |
| « Citoyen » 1516474200000
| 0 | ||
| Noob question: When in lobby ( the map when theres less than # mice ) how to disable the timer, sham and afk death |
| « Sénateur » 1516474680000
| 0 | ||
Borntolol a dit : Feel free to ask ^_^ Borntolol a dit : tfm.exec.disableAutoNewGame() tfm.exec.disableAutoShaman() -- Before the newGame! tfm.exec.disableAutoAfkDeath() You can check all the "disable" functions using Code Lua 1 2 3 for k in next, tfm.exec do To enable them, just set the parameter as "(false)", instead of "()" |
| « Citoyen » 1516474740000
| 0 | ||
| what does "k" mean in all these scripts tho |
| « Sénateur » 1516474860000
| 0 | ||
Borntolol a dit : It's just a variable name I set in the for. Do you come from any other language or you are a beginner? So I can help you in a different way. Anyways, the for syntax is Code Lua 1 2 3 for table_index, table_value in next, table_name do The standards are k,v m,n i,j |
| « Citoyen » 1516474920000
| 0 | ||
| o i only use basic coding and thats all never used lua before ^-^ |
| « Sénateur » 1516475040000
| 0 | ||
Borntolol a dit : Oh, I see, but what was the programming language? |
| « Citoyen » 1516475460000
| 0 | ||
| Im not entirely sure, also the print "" doesnt seem to work |
| « Sénateur » 1516475760000
| 0 | ||
Borntolol a dit : with table_name? Create a variable before the for.. table_name = {3, 4, 5, a = 1, b = 2,} btw table_name was just an example ^^ • [17:17] # [*Santa's Workshop] The table table_name has the value 3 in the index 1 • [17:17] # [*Santa's Workshop] The table table_name has the value 4 in the index 2 • [17:17] # [*Santa's Workshop] The table table_name has the value 5 in the index 3 • [17:17] # [*Santa's Workshop] The table table_name has the value 1 in the index a • [17:17] # [*Santa's Workshop] The table table_name has the value 2 in the index b Dernière modification le 1516475820000 |
| « Citoyen » 1516475880000
| 0 | ||
| I meant on this part if not isWaiting then isWaiting = true tfm.exec.disableAutoShaman() tfm.exec.newGame("@7366519") tfm.exec.disableAutoNewGame() print("5 mice is needed for start") |
| « Citoyen » 1516476960000
| 0 | ||
| no solution for it i guess? |