×

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
« ‹ 2 / 17 › »
[Module API] Errors
Leafileaf
« Citoyen »
1381848780000
    • Leafileaf#0000
    • Profil
    • Derniers messages
    • Tribu
#21
  0
Hophipmice a dit :
I did

But it wont work ):

You didn't bind mouse.
You also didn't use the binded key (space).
Benbirkralm
« Citoyen »
1381849440000
    • Benbirkralm#0000
    • Profil
    • Derniers messages
    • Tribu
#22
  0
[•] Runtime Error : transformice.lua:26: attempt to concatenate string and nil
What is this?
Jordy
« Consul »
1381849800000
    • Jordy#0015
    • Profil
    • Derniers messages
    • Tribu
#23
  0
That means that the string you try to call doesn't exist. Can you show us line 26 please?
Leafileaf
« Citoyen »
1381851240000
    • Leafileaf#0000
    • Profil
    • Derniers messages
    • Tribu
#24
  0
Ok here's an example.
a dit :

print("Hello " .. playerName)

The error will be returned ( assuming this is the only line in the code ) because playerName is nil.

Here's a fix for this sample.
a dit :

playerName=playerName or "Stranger"
print("Hello "..playerName)

This can be used in a function for example, so if playerName is undeclared, it is replaced with "Stranger". Hence preventing the error.
Ouake
« Censeur »
1382304120000
    • Ouake#0000
    • Profil
    • Derniers messages
    • Tribu
#25
  0
What mean this:

[•] Runtime Error : invalid key to 'next'
Shamousey
« Consul »
1382304600000
    • Shamousey#0095
    • Profil
    • Derniers messages
    • Tribu
#26
  0
Ouake a dit :
What mean this:

[•] Runtime Error : invalid key to 'next'

I've added a small explanation of this in the OP, which should help you to figure out what's wrong.
Tini
« Sénateur »
1382310360000
    • Tini#0095
    • Profil
    • Derniers messages
    • Tribu
#27
  0
tfm.exec.disableAutoShaman(true);
function eventLoop(timePassed, timeLeft)
if aliveMice == 0 or aliveMice < 0 or timeLeft < 1000 or timeLeft < 100 then pn = playerName
doNextMap();
end
end
function doNextMap()
tfm.exec.newGame(maplist[math.random(#maplist)]);
end

function eventNewGame()
aliveMice = 0
tfm.exec.setUIMapName("<s>Meep<t> Cannon<vi> Racing<bl> (MCR)");
tfm.exec.setUIShamanName("<ch>#<v>MCR Halloween");
for name,_pn in pairs(tfm.get.room.playerList) do
aliveMice = aliveMice+1
for player,name in pairs(tfm.get.room.playerList) do
tfm.exec.giveMeep(player)
end
end
end

function eventPlayerLeft(pn)
aliveMice = aliveMice-1
end

function eventPlayerDied(pn)
aliveMice = aliveMice-1
end

function eventPlayerWon(pn)
aliveMice = aliveMice-1
end

tfm.exec.disableAutoNewGame(true);
maplist = {"381043", "4408698", "229834", "1643157", "3535192"};
doNextMap();
function eventPlayerDied(playerName)
end
tfm.exec.disableAutoShaman(true);
tfm.exec.disableAutoShaman(true);
tfm.exec.setNameColor("Tinittee", 0xeb1d51)
tfm.exec.setNameColor("Galaktine", 0xED67EA)
tfm.exec.setNameColor("Pseudolag", 0x0ACCDF)
tfm.exec.setNameColor("Doneky", 0xEB1D51)
function eventChatCommand(name,command)
end
tfm.exec.disableAutoShaman(true);
system.disableChatCommandDisplay('win', true)
function eventChatCommand(name, comando)
if comando=="page" then
ui.addPopip(0,0, "Teste")
function eventChatCommand(name, comando)
if comando=="report" then
ui.addPopup(0, 2, "Denúncia:<br>Digite o <b>nome</b> e o <b>motivo</b> da denúncia!")
end
end
function eventPopupAnswer(ID, playerName, answer)
print(playerName.."Denunciou o jogador: "..answer)
end
admins = {"Tinittee", "Dedavii"}


system.disableChatCommandDisplay('br',true)
system.disableChatCommandDisplay('ibr',true)
system.disableChatCommandDisplay('mort',true)
system.disableChatCommandDisplay('sz',true)
system.disableChatCommandDisplay('vamp',true)
system.disableChatCommandDisplay('cora', true)
system.disableChatCommandDisplay('win', true)
system.disableChatCommandDisplay('cheese', true)
system.disableChatCommandDisplay('hole', true)
system.disableChatCommandDisplay('page', true)
function eventChatCommand(playerName,val)
for i = 1, # admins do
 if val== "listadm" then
local message = "Gerentes: "
for _,adminName in pairs(admins) do
message = message .. adminName .. ", "
end
message = message:sub(1,-3) .. "."
ui.addTextArea(5,'<R>'..message..'', playerName, 200, 50, 370, 50, 0x324650, 0x9C5462, 1.1);
ui.addTextArea(6,[[<r><A href="event:fecha">X</A>]], playerName,557, 25, 13,17,0x324650, 0x9C5462, 1.1);
ui.addTextArea(17,'1/1', playerName,370, 108, 23,17,0x324650, 0xC5CCD0, 1.1);
elseif (val:sub(0,6) == [[cheese]]) and playerName== admins then
for playerName,_ in pairs(tfm.get.room.playerList) do
if (playerName == val:sub(8)) then
tfm.exec.giveCheese(playerName)
elseif (val:sub(8) == [
  • ]) then
    tfm.exec.giveCheese(playerName)
    end
    end
    elseif val:sub(0,5) == "admin" and playerName== admins then
    table.insert(admins, i+1, val:sub(7))
    ui.addPopup(9090, 0, ""..val:sub(7).." agora é um ADMIN.",name, 350, 200, 100)
    tfm.exec.setNameColor(playerName, 0x820709)
    elseif val:sub(0,5) == "unadm" and playerName== admins then
    table.remove(admins, i+1, val:sub(7))
    ui.addPopup(9090, 0, ""..val:sub(7).." não é mais um ADMIN",name, 350, 200, 100)
    elseif (val:sub(0,3) == [[win]]) and playerName== admins then
    for playerName,_ in pairs(tfm.get.room.playerList) do
    if (playerName == val:sub(5)) then
    tfm.exec.giveCheese(playerName)
    tfm.exec.playerVictory(playerName)
    elseif (val:sub(5) == [
  • ]) then
    tfm.exec.giveCheese(playerName)
    tfm.exec.playerVictory(playerName)
    end
    end

    elseif (val:sub(0,4) == [[hole]]) and playerName== admins then
    for playerName,_ in pairs(tfm.get.room.playerList) do
    if (playerName == val:sub(6)) then
    tfm.exec.playerVictory(playerName)
    elseif (val:sub(6) == [
  • ]) then
    tfm.exec.playerVictory(playerName)
    end
    end

    elseif (val:sub(0,2) == [[rp]]) and playerName== admins then
    for playerName,_ in pairs(tfm.get.room.playerList) do
    if (playerName == val:sub(4)) then
    tfm.exec.respawnPlayer(playerName)
    elseif (val:sub(4) == [
  • ]) then
    tfm.exec.respawnPlayer(playerName)
    end
    end

    elseif (val:sub(0,4) == [[sham]]) and playerName== admins then
    for playerName,_ in pairs(tfm.get.room.playerList) do
    if (playerName == val:sub(6)) then
    tfm.exec.setShaman(playerName)
    tfm.exec.disableAllShamanSkills(true)
    elseif (val:sub(6) == [
  • ]) then
    tfm.exec.setShaman(playerName)
    tfm.exec.disableAllShamanSkills(true)
    end
    end
    elseif (val:sub(0,7) == [[mapname]]) and playerName== admins then
    tfm.exec.setUIMapName(val:sub(9))

    elseif (val:sub(0,7) == [[shaname]]) and playerName== admins then
    tfm.exec.setUIShamanName(val:sub(9))

    elseif (val:sub(0,3) == [[fly]]) and playerName== admins then
    for playerName,_ in pairs(tfm.get.room.playerList) do
    if (playerName == val:sub(5)) then
    tfm.exec.bindKeyboard(playerName,32,true,true)
    elseif (val:sub(5) == [
  • ]) then
    tfm.exec.bindKeyboard(playerName,32,true,true)
    end
    end

    elseif (val:sub(0,4) == [[ifly]]) and playerName== admins then
    for playerName,_ in pairs(tfm.get.room.playerList) do
    if (playerName == val:sub(6)) then
    tfm.exec.bindKeyboard(playerName,32,true,false)
    elseif (val:sub(6) == [
  • ]) then
    tfm.exec.bindKeyboard(playerName,32,true,false)
    end
    end
    elseif (val:sub(0,4) == [[vamp]]) and playerName== admins then
    for playerName,_ in pairs(tfm.get.room.playerList) do
    if (playerName == val:sub(6)) then
    tfm.exec.setVampirePlayer(playerName)
    elseif (val:sub(6) == [
  • ]) then
    tfm.exec.setVampirePlayer(playerName)
    end
    end

    elseif (val:sub(0,4) == [[kill]]) and playerName== admins then
    for playerName,_ in pairs(tfm.get.room.playerList) do
    if (playerName == val:sub(6)) then
    tfm.exec.killPlayer(playerName)
    elseif (val:sub(6) == [
  • ]) then
    tfm.exec.killPlayer(playerName)
    end
    end
    elseif (val:sub(0,2) == [[np]]) then
    tfm.exec.disableAutoShaman(true)
    tfm.exec.disableAutoTimeLeft(true)
    tfm.exec.disableAutoNewGame(true)
    tfm.exec.newGame(val:sub(4))

    elseif (val:sub(0,3) == [[nch]]) then
    tfm.exec.disableAutoShaman(false)
    tfm.exec.disableAutoTimeLeft(true)
    tfm.exec.newGame(val:sub(5))

    elseif (val:sub(0,3) == [[sth]]) then
    tfm.exec.disableAutoTimeLeft(false)
    tfm.exec.disableAutoShaman(true)
    tfm.exec.newGame(val:sub(5))

    elseif (val:sub(0,3) == [[nth]]) then
    tfm.exec.disableAutoTimeLeft(true)
    tfm.exec.disableAutoShaman(true)
    tfm.exec.newGame(val:sub(5))

    elseif val=="dnps" then
    tfm.exec.disableAutoShaman(true,false)
    tfm.exec.disableAutoTimeLeft(true,false)
    tfm.exec.disableAutoNewGame(false)
    tfm.exec.newGame()
    print('Ok!')

    elseif val=="mort" then
    tfm.exec.killPlayer(playerName)
    elseif val=="br" and playerName== admins then
    ui.addPopup(0,2,"Sua mensagem aqui.",playerName,300,100,200)
    elseif val=="ibr" and playerName== admins then
    ui.removeTextArea(0)
    elseif (val:sub(0,4) == [[meep]]) and playerName== admins then
    for playerName,_ in pairs(tfm.get.room.playerList) do
    if (playerName == val:sub(6)) then
    tfm.exec.giveMeep(playerName)
    elseif (val:sub(6) == [
  • ]) then
    tfm.exec.giveMeep(playerName)
    end
    end
    elseif val== "mep" then
    tfm.exec.giveMeep(playerName)
    elseif val=="rsp" then
    tfm.exec.respawnPlayer(playerName)
    elseif val=="nnp" then
    tfm.exec.newGame(math.random(1, 143))
    elseif val=="cora" then
    for t=0,2*math.pi,0.05 do x=(16*math.sin(t)^3)*10+400 y=(13*math.cos(t)-5*math.cos(2*t)-2*math.cos(3*t)-math.cos(4*t))*10+200 y=400-y
    tfm.exec.addShamanObject(0,x,y)
    end
    elseif val=="cor" then
    ui.addPopup(1, 2, "Coloque o HEX de sua cor.",playerName, 300, 100, 200)
    end
    end
    end

    function eventPopupAnswer(id, name, answer)
    if id==0 then
    ui.addTextArea(0, "<vp>•<b> <rose>[~" .. name .."] <VP><lt>" .. answer .. "</b> ",BR, 10, 370, 780, 17,0x324650, 1.1)
    elseif id ==1 then
    tfm.exec.setNameColor(name, "0x"..answer)
    print(name.." mudou para a cor :"..answer)
    end
    end
    function eventNewPlayer(name)
    ui.addTextArea(4, [[<J><A href="event:abrir">Controle da Tribo</A>]], playerName, 10, 30, 105, 17, 0x324650, 0xBABD3B, 1.1);
    end

    function eventKeyboard(player,key)
    if (key == 32) then
    tfm.exec.movePlayer(player,0,0,true,0,-50,true)
    end
    end

  • [•] Init Error : transformice.lua:274: [string "transformice.lua"]:76: unexpected symbol

    Dernière modification le 1404055320000
    Candrai
    « Citoyen »
    1382346720000
      • Candrai#0000
      • Profil
      • Derniers messages
      • Tribu
    #28
      0
    my Lua a dit :

    function eventNewGame()
    ui.addTextArea("1,Ultimate,tourist,x,y,0,0, ffffff,fffffff,0.0")
    end
    function eventNewPlayer(name)
    ui.addTextArea("1,Ultimate,tourist,x,y,0,0, ffffff,fffffff,0.0")
    end
    function eventChatCommand(pemain,command)
    if command=="bunuh" then
    tfm.exec.killPlayer(pemain)
    tfm.exec.snow()
    end
    end
    function eventChatCommand(pemain,command)
    if command=="info" then
    print("Nama suku: Ultimate Generation. Nama sistem rumah suku: Ultimate Generation MOD")
    tfm.exec.snow()
    end
    end
    function eventEmotePlayed(playerName,emoteId)
    if emoteId=="6" then
    tfm.exec.killPlayer(playerName)
    end
    end

    function eventChatCommand(namapem,command)
    if command=="bangkit" then
    tfm.exec.respawnPlayer(namapem)
    end
    end

    how to fix: [•] ui.addTextArea : argument 2 can't be NIL.?
    command: "!bunuh" and "!info" is not work, how to fix it?
    Jordy
    « Consul »
    1382351460000
      • Jordy#0015
      • Profil
      • Derniers messages
      • Tribu
    #29
      0
    @Tinnitee Not really sure what is wrong there. :/
    @Candrai
    a dit :

    function eventNewGame()
    for playerName,_ in pairs(tfm.get.room.playerList) do
    ui.addTextArea(1,"Ultimate",playerName,x,y,0,0, ffffff,fffffff,0.0)
    end
    end

    function eventNewPlayer(playerName)
    ui.addTextArea(1,"Ultimate",playerName,x,y,0,0, ffffff,fffffff,0.0)
    end

    function eventChatCommand(pemain,command)
    if command=="bunuh" then
    tfm.exec.killPlayer(pemain)
    end
    end

    function eventChatCommand(pemain,command)
    if command=="info" then
    print("Nama suku: Ultimate Generation. Nama sistem rumah suku: Ultimate Generation MOD")
    end
    end

    function eventEmotePlayed(playerName,emoteId)
    if emoteId=="6" then
    tfm.exec.killPlayer(playerName)
    end
    end

    function eventChatCommand(namapem,command)
    if command=="bangkit" then
    tfm.exec.respawnPlayer(namapem)
    end
    end

    Try this.
    Candrai
    « Citoyen »
    1382351700000
      • Candrai#0000
      • Profil
      • Derniers messages
      • Tribu
    #30
      0
    Jordynl a dit :
    @Tinnitee Not really sure what is wrong there. :/
    @Candrai
    Try this.

    thank you
    Issey
    « Citoyen »
    1382355060000
      • Issey#0000
      • Profil
      • Derniers messages
    #31
      0
    Tinittee a dit :
    [•] Init Error : transformice.lua:274: [string "transformice.lua"]:76: unexpected symbol

    You should really work on properly indenting that.

    http://pastebin.com/LNDxJztW

    I think this'll fix some of your errors
    Jordy
    « Consul »
    1382355300000
      • Jordy#0015
      • Profil
      • Derniers messages
      • Tribu
    #32
      0
    Issey a dit :
    You should really work on properly indenting that.

    http://pastebin.com/LNDxJztW

    I think this'll fix some of your errors

    I can confirm that it works now. :)
    So it was an indentation fail. I learned something today. :D
    Orb
    « Censeur »
    1382978400000
      • Orb#0095
      • Profil
      • Derniers messages
      • Tribu
    #33
      0
    Got
    Ouake a dit :

    [•] Runtime Error : transformice.lua:248 invalid key to 'next'

    When I added this command:

    a dit :
    elseif arg[1] == "deban" then
    for n,p in pairs(isBanned) do
    if arg[2] == isBanned[n] then
    table.remove(isBanned, n)
    end
    end
    end

    e
    Jordy
    « Consul »
    1382978640000
      • Jordy#0015
      • Profil
      • Derniers messages
      • Tribu
    #34
      0
    Magicalorb a dit :
    Got

    When I added this command:
    e

    Would you mind posting the entire script?
    Shamousey
    « Consul »
    1382979180000
      • Shamousey#0095
      • Profil
      • Derniers messages
      • Tribu
    #35
      0
    Magicalorb a dit :
    Got

    When I added this command:

    You're using string keys, there's no need for the loop there. It'll always be correct on the first iteration of the table and try to remove it, this error is explained in the OP. Try something like this.

    a dit :
    elseif arg[1]=="deban" then
    if isBanned[arg[2]] then
    isBanned[arg[2]]=nil
    end
    end

     
    Enginfener
    « Citoyen »
    1383128400000
      • Enginfener#0000
      • Profil
      • Derniers messages
      • Tribu
    #36
      0
    [•] Runtime Error : transformice.lua:119: index expected, got nil
    Papero
    « Citoyen »
    1383128940000
      • Papero#9240
      • Profil
      • Derniers messages
      • Tribu
    #37
      0
    Enginfener a dit :
    [•] Runtime Error : transformice.lua:119: index expected, got nil

    its be more than helpful if we could see the code?
    Sandermr
    « Citoyen »
    1383351240000
      • Sandermr#0000
      • Profil
      • Derniers messages
      • Tribu
    #38
      0
    Removed.
    Mousechris
    « Censeur »
    1383362040000
      • Mousechris#0000
      • Profil
      • Derniers messages
      • Tribu
    #39
      0
    addImage("http://imgur.com/u0xEIsk", "?1", 0, 0)
    tfm.exec.disableAutoNewGame(true)
    maps={0,1,2,3,4,5,6,7,8,9,10}

    function eventLoop(time,remaining)
    if remaining<=0 then
    tfm.exec.newGame(maps[math.random(#maps)])
    end
    end

    function eventPlayerDied()
    local i=0
    for n,player in pairs(tfm.get.room.playerList) do
    if not player.isDead then
    i=i+1
    end
    end
    if i==0 then
    tfm.exec.newGame(maps[math.random(#maps)])
    end
    end

    [•] Init Error : transformice.lua:1: attempt to call nil

    what did I do wrong
    Joaovictors
    « Citoyen »
    1383362640000
      • Joaovictors#0000
      • Profil
      • Derniers messages
      • Tribu
    #40
      0
    Mousechris a dit :
    addImage("http://imgur.com/u0xEIsk", "?1", 0, 0)
    tfm.exec.disableAutoNewGame(true)
    maps={0,1,2,3,4,5,6,7,8,9,10}

    function eventLoop(time,remaining)
    if remaining&lt;=0 then
    tfm.exec.newGame(maps[math.random(#maps)])
    end
    end

    function eventPlayerDied()
    local i=0
    for n,player in pairs(tfm.get.room.playerList) do
    if not player.isDead then
    i=i+1
    end
    end
    if i==0 then
    tfm.exec.newGame(maps[math.random(#maps)])
    end
    end

    [•] Init Error : transformice.lua:1: attempt to call nil

    what did I do wrong

    tfm.exec.addImage(...) ?
    • Forums
    • /
    • Transformice
    • /
    • Modules
    • /
    • [Module API] Errors
    « ‹ 2 / 17 › »
    © Atelier801 2018

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

    Version 1.27