Module API FAQ |
Discretooo 1389939960000
| | ||
[Modéré par Icewolfbob, raison : Please speak English here on the EN forums. Thank you!] |
Laagaadoo « Citoyen » 1390089720000
| 0 | ||
Lua Team members can use tfm.exec.chatMessage in the tribehouse? |
Shamousey « Consul » 1390090320000
| 0 | ||
Laagaadoo a dit : No, the Lua Team has the same powers as regular users in the tribe house. |
Quesoyquesos « Citoyen » 1390090440000
| 0 | ||
Lua team can use chat messaje in tribe and rooms or in rooms? |
Hophipmice « Citoyen » 1390123860000
| 0 | ||
Quesoyquesos a dit : Rooms only. |
Kittyepress « Citoyen » 1390138440000
| 0 | ||
Why in Infected one player name is pink? |
Benbirkralm « Citoyen » 1390228320000
| 0 | ||
Thanks. |
Bushmeister 1390231260000
| | ||
[Modéré par Bolinboy] |
Mousechris « Censeur » 1390629600000
| 0 | ||
Is there any way to put an XML into the script '[XML code here]' when I try to put one in I always get an error |
Safwanrockz « Censeur » 1390667880000
| 0 | ||
Mousechris a dit : Just put the xml in a string that starts and ends with two square brackets. a dit : |
Laagaadoo « Citoyen » 1390696320000
| 0 | ||
Why the math.random() choose three values instead one? I want only one value, but sometimes it choose three... a dit : The table has values. |
Mousechris « Censeur » 1390697820000
| 0 | ||
Safwanrockz a dit : No, I mean the script thing that way it can show an XML in the script start edit: apparently < can't be used in the chat, so oh well, nvm |
Safwanrockz « Censeur » 1390748640000
| 0 | ||
Mousechris a dit : Ooooh, you mean with printing the XML. You can simply do that with the gsub() function: a dit : Laagaadoo a dit : That script is wrong; basically math.random(a,b) is used to return a random NUMBER between a and b, for example math.random(1,10) returns a random number between 1 and 10. Likewise, math.random is used among tables to return a random number to be the index of this table, for example: a dit : This will print the FIRST value of the players table, which is "Safwanrockz". a dit : math.random() here will return a random number between 0 and the length of players table (which is 2), and then this number will be as a random index of the players table, hence a random value of the players table will be printed. Note that if math.random() is used with only one argument, it returns a random number between 0 and the argument you specified; for example math.random(9) returns a random number between 0 and 9. |
Laagaadoo « Citoyen » 1390757580000
| 0 | ||
Safwanrockz a dit : Thanks! The eventLoop influences the math.random ? I placed it in the eventLoop inside a "timer". |
Abdeltif « Citoyen » 1390757760000
| 0 | ||
Laagaadoo a dit : What do you exacly mean ? Also , eventLoop will call it more then once and it will chose a random number more then once ! You could put it outside the loop to chose a random number only once for all the time E : Saf you ninjad ! ;) |
Safwanrockz « Censeur » 1390757760000
| 0 | ||
Laagaadoo a dit : It works if it's within a body of an if statement, but preferably remove it from eventLoop(). |
Laagaadoo « Citoyen » 1390760520000
| 0 | ||
Safwanrockz a dit : I want choose a random player in 10 seconds, maybe the problem is the eventLoop()... |
Abdeltif « Citoyen » 1390763760000
| 0 | ||
Laagaadoo a dit : oh hmm What do you want to do with him? xD a dit : ---------You can also do this------------- a dit : . |
Efefay « Citoyen » 1390862820000
| 0 | ||
Simosc no longer plays so i would like to learn how to code lua. I just don't know where to start... There is so much information in the opening document |
Shamousey « Consul » 1390917960000
| 0 | ||
Efefay a dit : There are several links under the "Where can I learn Lua?" that direct you to places you can start learning Lua from scratch. Also, it'd be worth noting that the official documentation has been updated to fix a few things (Tigrounette's original documentation contained some wrong things, and lacking information in some places). Ontop of that, functions you can't use in the tribe house are also marked with a * so you know which aren't available. |