[Script] Colored Conjuration |
Mikuhl « Citoyen » 1388365140000
| 0 | ||
First off credit to Jordynl. I totally wasnt sneaking around your Lua rooms. *-* Just as the title suggests. Colorable Conjuration. a dit : How to use: a dit : |
Larenwa « Citoyen » 1388388480000
| 0 | ||
Cool! :D |
Livcorish « Citoyen » 1388432340000
| 0 | ||
Sweet! |
Safwanrockz « Censeur » 1388435280000
| 0 | ||
Well scripted. |
Babyaftchris « Citoyen » 1388508780000
| 0 | ||
Excited to try this out! After I gather 500 more cheese ;n; |
Evilsantah « Citoyen » 1388611200000
| 0 | ||
Safwanrockz a dit : table.remove while looping through the same table is a bad habit and can go horribly wrong, also math.random(0x000000,0xFFFFFF) gives back a number, not a string :DDD ily jack, I like it. E: not sure if it's platform dependant but for me the textarea doesn't have the correct size and position, anyway for me, this did the job: a dit : |
Safwanrockz « Censeur » 1388612460000
| 0 | ||
Evilsantah a dit : e/ Nvm, it's supposed to be an integer. |
Evilsantah « Citoyen » 1388613240000
| 0 | ||
Safwanrockz a dit : No, not at all. math.random will give back a number between 0x00000 and 0xFFFFFF, or in decimal 0 to 16777215. This means when passed to a function, it will be seen as a number. When you concat a string and a number (the .. operator) it converts the number to a string, and when this happens it will display it in decimal numeral system. In HTML, the color attribute takes different syntax but when prefixed with #, it will assume whatever's behind it is a hexadecimal value of 6 (or 3 like #FFF) characters, thus you will only get colors from #000000 to #999999. This is not what you wanted, you see :) tldr; use the %x string token to format hexadecimal numbers: Evilsantah a dit : Hope this clears up this conflict. |
Mikuhl « Citoyen » 1388613480000
| 0 | ||
I see. Back in my nooby days I saw it used, I guess I didnt check if it was correct because It gave me a color anyway so I thought it worked. EDIT: Updated, thanks to Evilsantah, the random hex colors are correctly used. Also, when you play another map and the conjuration dissappears so, do the color. |
0 | ||
|