×

Langue

Fermer
Atelier 801
  • Forums
  • Dev Tracker
  • Connexion
    • English Français
      Português do Brasil Español
      Türkçe Polski
      Magyar Română
      العربية Skandinavisk
      Nederlands Deutsch
      Bahasa Indonesia Русский
      中文 Filipino
      Lietuvių kalba 日本語
      Suomi עברית
      Italiano Česky
      Hrvatski Slovensky
      Български Latviešu
      Estonian
  • Langue
  • Forums
  • /
  • Transformice
  • /
  • Modules
  • /
  • [Module API] Errors
« ‹ 10 / 17 › »
[Module API] Errors
Zutto
« Citoyen »
1397152620000
    • Zutto#4451
    • Profil
    • Derniers messages
    • Tribu
#181
  0
a dit :

T = { {Name = "Mark", HP = 54, Breed = "Ghost"},
{Name = "Stan", HP = 24, Breed = "Zombie"},
{Name = "Juli", HP = 100, Breed = "Human"},
{ HP = 100, Breed = "Human"}
}

function Sorting(T)
table.sort(T)
end

function xy(x, y)
if x.Name == nil or y.Name == nil then return x.HP < y.HP
else
return x.Name < y.Name and x.HP < y.HP
end
end

How can I show the stats in a text area?
Cactusjack
« Citoyen »
1397218380000
    • Cactusjack#4408
    • Profil
    • Derniers messages
    • Tribu
#182
  0
Aritxy a dit :
How can I show the stats in a text area?

foo a dit :
T = { {Name = "Mark", HP = 54, Breed = "Ghost"},
{Name = "Stan", HP = 24, Breed = "Zombie"},
{Name = "Juli", HP = 100, Breed = "Human"},
{ HP = 100, Breed = "Human"}
}

temp = {}

table.sort(T, function (x, y) return x.HP > y.HP end)

for _, value in ipairs(T) do
local main = (value.Name or "Foo") .. " - " .. value.HP .. " - ".. value.Breed
temp[#temp+1] = main -- or table.insert(temp, main)
end

ui.addPopup(0,0,table.concat(temp, "\n"),nil,300,100)

text
Opsfentek
« Citoyen »
1397232720000
    • Opsfentek#0000
    • Profil
    • Derniers messages
    • Tribu
#183
  0
a dit :
a = {}

function as(x,y)
return x+y
end

print (as(4.12346,2.56f34))

## Init Error : For input string: "2.56f34"
Zutto
« Citoyen »
1397247060000
    • Zutto#4451
    • Profil
    • Derniers messages
    • Tribu
#184
  0
Opsfentek a dit :


## Init Error : For input string: "2.56f34"

Remove the f
Ahmedkoky
1397778420000
    • Ahmedkoky#0000
    • Profil
    • Derniers messages
    • Tribu
#185
[Modéré par Bolinboy]
Ahmedkoky
1398124620000
    • Ahmedkoky#0000
    • Profil
    • Derniers messages
    • Tribu
#186
[Modéré par Katburger, raison : Spam]
Ygtyk
« Citoyen »
1398626520000
    • Ygtyk#0000
    • Profil
    • Derniers messages
    • Tribu
#187
  0
tfm.exec.disableshamanskills(true)
and no work
Gabrijelr
« Citoyen »
1398627420000
    • Gabrijelr#0000
    • Profil
    • Derniers messages
    • Tribu
#188
  0
Ygtyk a dit :
tfm.exec.disableshamanskills(true)
and no work

Try this:
tfm.exec.disable"All"ShamanSkills(true)

tfm.exec.disableAllShamanSkills(true)

You got an error because you didn't put "all" and it's all lowercase.
Epicsouris
« Citoyen »
1398627840000
    • Epicsouris#0000
    • Profil
    • Derniers messages
#189
  0
Gabrijelr a dit :


Try this:
tfm.exec.disable"All"ShamanSkills(true)
tfm.exec.disableAllShamanSkills(true)
You got an error because you didn't put "all" and it's all lowercase.

Also, Ygtyk might have forgot to put that snippet BEFORE tfm.exec.newGame()
Gabrijelr
« Citoyen »
1398628560000
    • Gabrijelr#0000
    • Profil
    • Derniers messages
    • Tribu
#190
  0
Epicsouris a dit :


Also, Ygtyk might have forgot to put that snippet BEFORE tfm.exec.newGame()

He got an error, that's because he wrote "tfm.exec.disableshamanskills(true)"
insted of "tfm.exec.disableAllShamanSkills(true)"
Change the colour of "before" to #FF00FF as you always do XD (It's so eays to remember the code)
Zutto
« Citoyen »
1399804260000
    • Zutto#4451
    • Profil
    • Derniers messages
    • Tribu
#191
  0
a dit :

Script

Why does it give error in the return?

return x.score > y.score
error
Safwanrockz
« Censeur »
1399806300000
    • Safwanrockz#0095
    • Profil
    • Derniers messages
    • Tribu
#192
  0
How would you like your table to be sorted out though? Because the second argument of table.sort() is a function that should not contain any outer arguments (You had x.score and y.score).
Zutto
« Citoyen »
1399806960000
    • Zutto#4451
    • Profil
    • Derniers messages
    • Tribu
#193
  0
Safwanrockz a dit :
How would you like your table to be sorted out though? Because the second argument of table.sort() is a function that should not contain any outer arguments (You had x.score and y.score).

fixed thanks ^^
Cagataymylov
« Censeur »
1401022920000
    • Cagataymylov#0000
    • Profil
    • Derniers messages
    • Tribu
#194
  0
Why everytime I load a lua script/minigame
It appears like this : ## Init Error : Haxhhhhhhhhh.lua:4: [string "Cagataymylov.lua"]:1: unexpected symbol

edit: nvm solved it
Cheesehogga
« Citoyen »
1401245940000
    • Cheesehogga#0000
    • Profil
    • Derniers messages
    • Tribu
#195
  0
This loads properly

Chat a dit :

## [Cheesehogga] Lua script loaded in 1 ms (4000 max)

Lua Script a dit :
for name, player in pairs(tfm.get.room.playerList) do
tfm.exec.bindKeyboard(name, 9, true, true)
system.bindMouse(name, true)
end
function tfm.eventKeyboard(name, key, down, x, y)
if key==9 then
tfm.exec.tfm.exec.giveCheese(name)
end
end

Not sure why this is happening. I press Tab and nothing.
Shamousey
« Consul »
1401373680000
    • Shamousey#0095
    • Profil
    • Derniers messages
    • Tribu
#196
  0
Cheesehogga a dit :
This loads properly

Not sure why this is happening. I press Tab and nothing.

It's meant to be eventKeyboard, not tfm.eventKeyboard. It's also meant to be tfm.exec.giveCheese, not tfm.exec.tfm.exec.giveCheese.
Alexiaho
« Citoyen »
1401477840000
    • Alexiaho#0000
    • Profil
    • Derniers messages
    • Tribu
#197
  0
tfm.exe.chatMessage()

dont work
Bloncked
« Citoyen »
1401584100000
    • Bloncked#0000
    • Profil
    • Derniers messages
#198
  0
Alexiaho a dit :
tfm.exe.chatMessage()

dont work

only lua team can use this
Palhacinhomt
1401643260000
    • Palhacinhomt#0000
    • Profil
    • Derniers messages
#199
[Modéré par Icewolfbob, raison : Please speak English on EN. Thank you!]
Demon
« Citoyen »
1401700440000
    • Demon#3348
    • Profil
    • Derniers messages
#200
  0
[Dobrjik] !respawn
## Argument error.

Script -

function eventChatCommand(name,cmd)
local arg={}
for argument in cmd:gmatch("[^%s]+") do
table.insert(arg, argument);
end
if arg[1]=="respawn" then
tfm.exec.respawnPlayer(arg[2])
end
end
  • Forums
  • /
  • Transformice
  • /
  • Modules
  • /
  • [Module API] Errors
« ‹ 10 / 17 › »
© Atelier801 2018

Equipe Conditions Générales d'Utilisation Politique de Confidentialité Contact

Version 1.27