×

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
« ‹ 7 / 17 › »
[Module API] Errors
Shamousey
« Consul »
1389757140000
    • Shamousey#0095
    • Profil
    • Derniers messages
    • Tribu
#121
  0
Luanpow a dit :
What problem

It works fine for me. You'd be better off not sharing scripts that show people's XMLs however.
Barsems
« Citoyen »
1389793140000
    • Barsems#0000
    • Profil
    • Derniers messages
#122
  0
What error/errors?

ui.addTextArea(987,"Oyuncuya Bir Rütbe Ver", NIL, 400, 200, 100, 100, 0xFFFF, 0xFFFFF, 0.6,true)
ui.addTextArea(182,"<p align='center'><a href='event:yardimci'><b><R>Yardımcı</b></a></p>",name,400,284,100,16,1,1,0.8,true)
ui.addTextArea(2,"<p align='center'><a href='event:moderator'><b><R>Mod</b></a></p>",name,400,258,100,16,1,1,0.8,true)
function eventTextAreaCallback(id, name, callback)
if callback=="yardimci" then
ui.addPopup(934,2,"Yardımcıyı Seç",name,350,110,200)
function eventPopupAnswer(popupId,playerName,command)
tfm.exec.setNameColor(command,0xFFFF)
end
end
if callback=="moderator" then
ui.addPopup(941,2,"Moderatörü Seç",name,350,110,200)
function eventPopupAnswer(popupId,playerName,command)
tfm.exec.setNameColor(command,0xFF000)
end
end
end

Argument error.
(Edit)
Issey
« Citoyen »
1389898620000
    • Issey#0000
    • Profil
    • Derniers messages
#123
  0
Barsems a dit :
What error/errors?
Argument error.

a dit :
ui.addTextArea(987,"Oyuncuya Bir Rütbe Ver", NIL, 400, 200, 100, 100, 0xFFFF, 0xFFFF, 0.6)
ui.addTextArea(182,"<p align='center'><a href='event:yardimci'><b><R>Yardımcı</b></a></p>",name,400,287,100,16,1,1,0.8,true)
ui.addTextArea(2,"<p align='center'><a href='event:moderator'><b><R>Mod</b></a></p>",name,400,261,100,16,1,1,0.8,true)

function eventTextAreaCallback(id, name, callback)
if callback=="yardimci" then
ui.addPopup(934,2,"Yardımcıyı Seç",name,400,200,200)
end
if callback=="moderator" then
ui.addPopup(941,2,"Moderatörü Seç",name,400,200,200)
end
end --was missing

function eventPopupAnswer(id,playerName,command)
if id=="934" then
tfm.exec.setNameColor(command,0xFFFF)
end
if id=="941" then
tfm.exec.setNameColor(command,0xFF0000)
end
end

Following the syntax always helps you know
Discretooo
1389939960000
    • Discretooo#0000
    • Profil
    • Derniers messages
    • Tribu
#124
[Modéré par Icewolfbob, raison : Please speak English here. Thank you!]
Barsems
« Citoyen »
1389995100000
    • Barsems#0000
    • Profil
    • Derniers messages
#125
  0
for name,player in pairs(tfm.get.room.playerList) do
for i,key in ipairs({49,50}) do
tfm.exec.bindKeyboard(name,key,true,true)
end
end

function eventKeyboard(name, key, down, x, y)
if key == 49 thend
tfm.exec.killPlayer(name)
tfm.exec.addShamanObject(54, x, y, 0, 0, 0, false)
end
end
if key == 50 then
tfm.exec.respawnPlayer(name)
tfm.exec.movePlayer(name, x, y, true)
end
end

Init Error : Ediz.lua:267: [string "Barsems.lua"]:466: ')' expected
[Barsems] Lua script loaded in 2 ms (4000 max)
Safwanrockz
« Censeur »
1390001100000
    • Safwanrockz#0095
    • Profil
    • Derniers messages
    • Tribu
#126
  0
You've got plenty of errors in your script, use this:
a dit :

function eventNewPlayer(name)
for i,key in ipairs({49, 50}) do
tfm.exec.bindKeyboard(name,key,true,true)
end
end
for name in pairs(tfm.get.room.playerList) do
eventNewPlayer(name)
end -- Not sure if nested loops work, hence I replaced it with this.

function eventKeyboard(name, key, down, x, y)
if key == 49 then
tfm.exec.killPlayer(name)
tfm.exec.addShamanObject(54, x, y)
elseif key == 50 then
tfm.exec.respawnPlayer(name)
tfm.exec.movePlayer(name, x, y)
end
end

 
Barsems
« Citoyen »
1390327500000
    • Barsems#0000
    • Profil
    • Derniers messages
#127
  0
Safwanrockz a dit :
You've got plenty of errors in your script, use this:
 

Thanks.
Barsems
« Citoyen »
1390411380000
    • Barsems#0000
    • Profil
    • Derniers messages
#128
  0
What errors?

function eventEmotePlayed(playerName,id)
if id==8 then
ui.addTextArea(397,"Hi",name, x, y-30, 150, 100, 0xFFFF, 0xFFFFF, 0.6,true)
end
end

## Runtime Error : Barsems.lua:506: attempt to perform arithmetic __sub on nil and number
Shamousey
« Consul »
1390412160000
    • Shamousey#0095
    • Profil
    • Derniers messages
    • Tribu
#129
  0
Your function passes the argument "playerName" but you're trying to use it as "name". HEX numbers are meant to be 6 characters long, while you have 4 and 5 long variations it should be "0xFFFFFF". The actual error at hand is likely down to you not having "x" and "y" variables.
Barsems
« Citoyen »
1390412280000
    • Barsems#0000
    • Profil
    • Derniers messages
#130
  0
Thanks
Neonstrayzer
« Citoyen »
1390420200000
    • Neonstrayzer#0000
    • Profil
    • Derniers messages
    • Tribu
#131
  0
What is error ?
if callback=="friendlist" then
ui.addTextArea(6,"Friends<br>"..players[name].friends.."",name,650,20,50,50)
end
## Runtime Error : Neonstrayzer.lua:47: attempt to index ? (a nil value)
Safwanrockz
« Censeur »
1390423020000
    • Safwanrockz#0095
    • Profil
    • Derniers messages
    • Tribu
#132
  0
Neonstrayzer a dit :
What is error ?
if callback=="friendlist" then
ui.addTextArea(6,"Friends&amp;lt;br&amp;gt;"..players[name].friends.."",name,650,20,50,50)
end
## Runtime Error : Neonstrayzer.lua:47: attempt to index ? (a nil value)

The code doesn't make sense, you should try putting eventTextAreaCallback(name,id,cb) at the beginning of the script, and end it at the end of it.
Anyway, it wouldn't work because there is no "friendlist" callback.
Neonstrayzer
« Citoyen »
1390423920000
    • Neonstrayzer#0000
    • Profil
    • Derniers messages
    • Tribu
#133
  0
Safwanrockz a dit :
The code doesn't make sense, you should try putting eventTextAreaCallback(name,id,cb) at the beginning of the script, and end it at the end of it.
Anyway, it wouldn't work because there is no "friendlist" callback.

Already have to eventTextAreaCallback(name,id,cb). But, to be easy to that, I didn't want to specify.

EDİT : Solve to problem :)

red={}
blue={}
function eventKeyboard(name,key,down,x,y)
if key==17 then
ui.addTextArea(89,"Red Team \n" ..text.red.. "\n Blue Team" ..text.blue.."",name,50,50,200,200,0xff0000,0x00ffff,2.5)--cipsden yardı alsak
end
end
function eventNewPlayer(name)
tfm.exec.bindKeyboard(name,17,true,true)
makeTeams()
end
for name,player in pairs(tfm.get.room.playerList) do
eventNewPlayer(name)
end

What is error ?
Neonstrayzer
1390476120000
    • Neonstrayzer#0000
    • Profil
    • Derniers messages
    • Tribu
#134
[Modéré par Icewolfbob, raison : Merged]
Safwanrockz
« Censeur »
1390490460000
    • Safwanrockz#0095
    • Profil
    • Derniers messages
    • Tribu
#135
  0
There is no function makeTeams() in the script.
Byenamo
« Citoyen »
1390683240000
    • Byenamo#0000
    • Profil
    • Derniers messages
    • Tribu
#136
  0
for i in pairs(tfm.get.room.playerList) do
eventEmotePlayed(i,0)
end

What is error ?
Safwanrockz
« Censeur »
1390748760000
    • Safwanrockz#0095
    • Profil
    • Derniers messages
    • Tribu
#137
  0
I'm guessing you want to make everyone in the room dance, which is impossible.
eventEmotePlayed is an event, not a function.
Barsems
« Citoyen »
1392041340000
    • Barsems#0000
    • Profil
    • Derniers messages
#138
  0
(edit)
Cactusjack
« Citoyen »
1392042060000
    • Cactusjack#4408
    • Profil
    • Derniers messages
    • Tribu
#139
  0
Barsems a dit :
What's error/errors?

Pretty much everything, do you know anything about Lua?
You should give this a read, it may help you out. Topic-365251
Bethdacat
« Consul »
1392415200000
    • Bethdacat#0000
    • Profil
    • Derniers messages
    • Tribu
#140
  0
help = "<BV>Hello! Welcome to #Glitched! <N>Make sure that shaman vampire or vampire does not get you!<J> They will<R> hunt<N> you! ^-^"
ui.addTextArea(0, "<a href='event:help'>?</a>", nil)

function eventTextAreaCallback(name,id,cb)
if cb=="help" then
ui.updateTextArea(0, help, nil)
end
end

tfm.exec.setUIMapName("<N>#Glitched")

players = {}
for name,player in pairs(tfm.get.room.playerList) do
table.insert(players,name)
end
tfm.exec.setVampirePlayer(players[math.random(#players)])

players = {}
for name,player in pairs(tfm.get.room.playerList) do
table.insert(players,name)
end
tfm.exec.setShaman(players[math.random(#players)])

function.startNewGame
tfm.exec.newGame (maps[math.random(#10)]);
end

function eventLoop (a, timeLeft)
if timeLeft <= 0 then
startNewGame();
end
end

elseif (playersAlive ==0) then
startNewGame();
end
end

[At line 24. What's wrong with this?]
  • Forums
  • /
  • Transformice
  • /
  • Modules
  • /
  • [Module API] Errors
« ‹ 7 / 17 › »
© Atelier801 2018

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

Version 1.27