×

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
« ‹ 8 / 17 › »
[Module API] Errors
Shamousey
« Consul »
1392415560000
    • Shamousey#0095
    • Profil
    • Derniers messages
    • Tribu
#141
  0
function.startNewGame isn't how you define a function. You already define functions in other places in this script that work. You can try function startNewGame() or alternatively startNewGame=function()

Your last 4 lines has an elseif starting from nowhere, however.
Epicshawty
« Citoyen »
1392489960000
    • Epicshawty#0000
    • Profil
    • Derniers messages
    • Tribu
#142
  0
Bethdacat a dit :

[At line 24. What's wrong with this?]

it'd help if you put the code in a quote...
anyways, i believe in your last part fo the code you're making it so if all the players are dead then we start a new game right?
well shamousey has a code for you that im giving you for the future, it'll make it so when all players are dead then we start a new game

Shamousey a dit :

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

From Topic-457950
Barsems
« Citoyen »
1392898380000
    • Barsems#0000
    • Profil
    • Derniers messages
#143
  0
Runtime Error :attempt to call table

What does this mean?
Fireyone
« Citoyen »
1392898560000
    • Fireyone#0000
    • Profil
    • Derniers messages
    • Tribu
#144
  0
Can
testFuction be used to indicate all players a name or a question ?
Safwanrockz
« Censeur »
1392905460000
    • Safwanrockz#0095
    • Profil
    • Derniers messages
    • Tribu
#145
  0
Barsems a dit :
Runtime Error :attempt to call table

What does this mean?

This mostly happens when trying to call a table with a for loop operation without the pairs() function:
a dit :

t={"table"}
for i in t do
print(i)
end

Correction:
a dit :

t={"table"}
for i in pairs(t) do
print(i)
end

 
Ygtyk
« Citoyen »
1392950100000
    • Ygtyk#0000
    • Profil
    • Derniers messages
    • Tribu
#146
  0
function startNewGame(boxing)
tfm.add boxing maps(*899,90)for
player.name(tfm.room)do
tfm exe move(o,o,false,boxing)
end
end
[url]____________________[/url] ## Init Error : Musugas.lua:98: [string "Ygtyk.lua"]:2: '=' expected
and no work
Fireyone
« Citoyen »
1392986220000
    • Fireyone#0000
    • Profil
    • Derniers messages
    • Tribu
#147
  0
Ygtyk a dit :
function startNewGame(boxing)
tfm.add boxing maps(*899,90)for
player.name(tfm.room)do
tfm exe move(o,o,false,boxing)
end
end
[url]____________________[/url] ## Init Error : Musugas.lua:98: [string "Ygtyk.lua"]:2: '=' expected
and no work

I really dont think that''s a scipt I mean
startNewGame(boxing) makes no type of sense if it would have been
"map boxing" with codes for the maps to play it randomly then maybe.
Hophipmice
« Citoyen »
1393017840000
    • Hophipmice#0000
    • Profil
    • Derniers messages
    • Tribu
#148
  0
Ygtyk a dit :
function startNewGame(boxing)
tfm.add boxing maps(*899,90)for
player.name(tfm.room)do
tfm exe move(o,o,false,boxing)
end
end
[url]____________________[/url] ## Init Error : Musugas.lua:98: [string "Ygtyk.lua"]:2: '=' expected
and no work

Ok.

First of all, you haven't defined boxing anywhere. For example:

maps = {0, 1, 2}

tfm.exec.newGame(maps[math.random(#maps)])

in this way, it'll play the maps from the maps table!

Secondly, there is nothing such as 'Function startNewGame' unless you want to create your own function which is unlike with your code.

If you have learnt lua/read the API. You can't do tfm.add. It's must me 'tfm.exec.yourfunction(yourthings)'

Also, your code says
tfm.add boxing maps. Where are boxing and maps defined?

tfm.add boxing maps(*899,90)for, <what? I think this is ment to be in the next line.

Second to last: it should be :

for name,player in pairs(tfm.get.room.playerList) do

end

lastly, what is tfm exec move?

If you're meant to move the player:

movePlayer
String playerName, Int xPosition, Int yPosition, Boolean offset, Int xSpeed, Int ySpeed, Boolean offset
Defines the speed and position of a player.

or if not then always remember tfm.exec. !

Hope I helped and understood your script properly if not I'm sorry and please speak to me in game!
Fireyone
« Citoyen »
1393029360000
    • Fireyone#0000
    • Profil
    • Derniers messages
    • Tribu
#149
  0
Any script that needs to be defined has to be at the beginning like a code I was working on a website

var x = 11;
That notifies what it's supposed to do but only at beggining makes the code work.
Barsems
« Citoyen »
1393073760000
    • Barsems#0000
    • Profil
    • Derniers messages
#150
  0
What does this mean ## Init Error : 15341
Oyga
« Citoyen »
1393074900000
    • Oyga#0000
    • Profil
    • Derniers messages
    • Tribu
#151
  0
Barsems a dit :
What does this mean ## Init Error : 15341

Oyga a dit :
Ya kabileler bozuk, yada Lua'ya güncelleme gelecek. Bü yüzden kabilede /module ve /lua kapalı.

^
Barsems
« Citoyen »
1393074900000
    • Barsems#0000
    • Profil
    • Derniers messages
#152
  0
Oyga a dit :
Ya kabileler bozuk, yada Lua'ya güncelleme gelecek. Bü yüzden kabilede /module ve /lua kapalı.

It's Turkish.
Erikq
« Citoyen »
1393077840000
    • Erikq#0000
    • Profil
    • Derniers messages
    • Tribu
#153
  0
why I appear: ## Init Error : 16233
Hophipmice
« Citoyen »
1393077840000
    • Hophipmice#0000
    • Profil
    • Derniers messages
    • Tribu
#154
  0
Guys, lua isn't working in tribe houses. That's all. It's the same for everyone.
Mymicemy
« Citoyen »
1393080660000
    • Mymicemy#0000
    • Profil
    • Derniers messages
    • Tribu
#155
  0
Hophipmice a dit :
Guys, lua isn't working in tribe houses. That's all. It's the same for everyone.

Really? Omg why?

e: it's just a bug or something?
Thetroz
« Citoyen »
1393083360000
    • Thetroz#0000
    • Profil
    • Derniers messages
    • Tribu
#156
  0
Hophipmice a dit :
Guys, lua isn't working in tribe houses. That's all. It's the same for everyone.

OMG D:
Ygtyk
« Citoyen »
1393093620000
    • Ygtyk#0000
    • Profil
    • Derniers messages
    • Tribu
#157
  0
Hophipmice a dit :
Ok.

First of all, you haven't defined boxing anywhere. For example:

maps = {0, 1, 2}

tfm.exec.newGame(maps[math.random(#maps)])

in this way, it'll play the maps from the maps table!

Secondly, there is nothing such as 'Function startNewGame' unless you want to create your own function which is unlike with your code.

If you have learnt lua/read the API. You can't do tfm.add. It's must me 'tfm.exec.yourfunction(yourthings)'

Also, your code says
tfm.add boxing maps. Where are boxing and maps defined?

tfm.add boxing maps(*899,90)for, <what? I think this is ment to be in the next line.

Second to last: it should be :

for name,player in pairs(tfm.get.room.playerList) do

end

lastly, what is tfm exec move?

If you're meant to move the player:

movePlayer
String playerName, Int xPosition, Int yPosition, Boolean offset, Int xSpeed, Int ySpeed, Boolean offset
Defines the speed and position of a player.

or if not then always remember tfm.exec. !

Hope I helped and understood your script properly if not I'm sorry and please speak to me in game!

Do you mean something like this[url]|[/url] function newgame(boxing)
---Maps---
maps={@2838853}
tfm.exec.newGame(maps[math.random(#maps)])
---Admins---
admins={}
---Help---
Knock the other player off the boxing mach and you will win.
do tfm.exe.{o,o,true,false,}
tfm.newgame.for players name{tfm.room} our like this function newgame(boxing)
---Maps---
maps={@2838853}
---Admins---
admins={Ygtyk}
---Help---
Knock the other player off the boxing mach and you will win.
do tfm.exe.{o,o,true,false,}
tfm.newgame.for players name{}
or like this function newgame(boxing)
---Maps---
maps={@2838853}
---Admins---
admins={Ygtyk}
---Help---
Knock the other player off the boxing mach and you will win.
do tfm.exe.{o,o,true,false,}
tfm.newgame.for players name{}
Fireyone
« Citoyen »
1393114080000
    • Fireyone#0000
    • Profil
    • Derniers messages
    • Tribu
#158
  0
^ Ygtky basically kinda like that but your variables must be explained.
Hophipmice
« Citoyen »
1393159680000
    • Hophipmice#0000
    • Profil
    • Derniers messages
    • Tribu
#159
  0
Ygtyk a dit :


Do you mean something like this[url]|[/url] function newgame(boxing)
---Maps---
maps={@2838853}
tfm.exec.newGame(maps[math.random(#maps)])
---Admins---
admins={}
---Help---
Knock the other player off the boxing mach and you will win.
do tfm.exe.{o,o,true,false,}
tfm.newgame.for players name{tfm.room} our like this function newgame(boxing)
---Maps---
maps={@2838853}
---Admins---
admins={Ygtyk}
---Help---
Knock the other player off the boxing mach and you will win.
do tfm.exe.{o,o,true,false,}
tfm.newgame.for players name{}[/#en][#br]or like this function newgame(boxing)
---Maps---
maps={@2838853}
---Admins---
admins={Ygtyk}
---Help---
Knock the other player off the boxing mach and you will win.
do tfm.exe.{o,o,true,false,}
tfm.newgame.for players name{}

Not exactly...

PM me in game and I'll help you.

E:


http://www.transformice.com/share/api.png
I see why you used that...
Immagetcheez
« Citoyen »
1393435080000
    • Immagetcheez#0000
    • Profil
    • Derniers messages
#160
  0
So I'm really confused

Are modules down? Or am typing things wrong? The only room I've connected to succesfully was PewPew.
  • Forums
  • /
  • Transformice
  • /
  • Modules
  • /
  • [Module API] Errors
« ‹ 8 / 17 › »
© Atelier801 2018

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

Version 1.27