×

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
  • /
  • [Poradnik]Lua
« ‹ 3 / 10 › »
[Poradnik]Lua
Ouake
« Censeur »
1384600800000
    • Ouake#0000
    • Profil
    • Derniers messages
    • Tribu
#41
  0
Chyba jest możliwe, ale musiało by być bez użycia tfm.exec.explosion(...), bo to zawsze działa na myszy. Można by wykorzystać tfm.exec.moveObject(...), ale wtedy każdy obiekt musiałby zostać nazwany.
Sebakpl
1384615140000
    • Sebakpl#0000
    • Profil
    • Derniers messages
    • Tribu
#42
[Modéré par Coska, raison : Spam.~]
Marcinsto
1384682580000
    • Marcinsto#0000
    • Profil
    • Derniers messages
#43
[Modéré par Coska]
Marcinsto
1384683000000
    • Marcinsto#0000
    • Profil
    • Derniers messages
#44
[Modéré par Coska]
Muzykmysz
« Sénateur »
1388307660000
    • Muzykmysz#9003
    • Profil
    • Derniers messages
    • Tribu
#45
  0
Ej a jak się wyłącza utility?
Ouake
« Censeur »
1388335320000
    • Ouake#0000
    • Profil
    • Derniers messages
    • Tribu
#46
  0
/module stop

Wszystko jest w [ Topic-58605 ]"Lista komend" w Dyskusje Transformice.
Deathpll
1388936160000
    • Deathpll#0000
    • Profil
    • Derniers messages
    • Tribu
#47
[Modéré par Coska]
Matinpnz
« Citoyen »
1388940360000
    • Matinpnz#0000
    • Profil
    • Derniers messages
#48
  0
Skopiuje mi ktoś kod /lua ?
Ouake
« Censeur »
1388948940000
    • Ouake#0000
    • Profil
    • Derniers messages
    • Tribu
#49
  0
Nie wiem co robisz, ale możesz użyć skrótu CTRL+A, ale najpierw kliknij tekst skryptu byle gdzie.
Kamilijulka
« Citoyen »
1391159760000
    • Kamilijulka#0000
    • Profil
    • Derniers messages
    • Tribu
#50
  0
ja tu zonmce transformice
Lisaczek
« Citoyen »
1392122460000
    • Lisaczek#4719
    • Profil
    • Derniers messages
    • Tribu
#51
  0
Co zrobic bo mi wyskocyło takie cos:

## [Mateuszasdg] Lua script loaded in 1 ms (4000 max)
## tfm.exec.bindKeyboard : argument 1 can't be NIL.
## tfm.exec.bindKeyboard : argument 1 can't be NIL.
## tfm.exec.bindKeyboard : argument 1 can't be NIL.
## tfm.exec.bindKeyboard : argument 1 can't be NIL.
## tfm.exec.bindKeyboard : argument 1 can't be NIL.
## tfm.exec.bindKeyboard : argument 1 can't be NIL.

a potem jak pisałem komende to wyskocyło:

## Runtime Error : Mateuszasdg.lua:9: index expected, got nil

Co mam zrobic??
Woterek
« Citoyen »
1392125520000
    • Woterek#0000
    • Profil
    • Derniers messages
    • Tribu
#52
  0
Mateuszasdg a dit :
Co zrobic bo mi wyskocyło takie cos:

## [Mateuszasdg] Lua script loaded in 1 ms (4000 max)
## tfm.exec.bindKeyboard : argument 1 can't be NIL.
## tfm.exec.bindKeyboard : argument 1 can't be NIL.
## tfm.exec.bindKeyboard : argument 1 can't be NIL.
## tfm.exec.bindKeyboard : argument 1 can't be NIL.
## tfm.exec.bindKeyboard : argument 1 can't be NIL.
## tfm.exec.bindKeyboard : argument 1 can't be NIL.

a potem jak pisałem komende to wyskocyło:

## Runtime Error : Mateuszasdg.lua:9: index expected, got nil

Co mam zrobic??

Jeśli chcesz by ktokolwiek ci pomógł musisz podać nam kod, pozatym nie jest to temat do zgłaszania błędów z naszymi kodami chociaż nie powiem nie przydałby się jeden.
Lisaczek
« Citoyen »
1392135780000
    • Lisaczek#4719
    • Profil
    • Derniers messages
    • Tribu
#53
  0
Woterek a dit :
Jeśli chcesz by ktokolwiek ci pomógł musisz podać nam kod, pozatym nie jest to temat do zgłaszania błędów z naszymi kodami chociaż nie powiem nie przydałby się jeden.

O to kod:

function eventNewPlayer(name)
for i,key in ipairs({83,40,69,}) do
tfm.exec.bindKeyboard(name,key,true,true)
end
end

function eventChatCommand(name, com)
if com == "Hack" then
zm[name] = 1
elseif com == "xD" then
zm[name] = 2
end
end

function eventKeyboard(name,key,down,x,y)
if key==83 or key==40 or key==69 then
if zm[name] == 2 then
if tfm.get.room.playerList[name].isFacingRight then
tfm.exec.addShamanObject(19,x,y)
else
tfm.exec.addShamanObject(20,x,y)
end
end
if zm[name] == 1 then
tfm.exec.addShamanObject(24,x,y)
end
end
end

for name in pairs(tfm.get.room.playerList) do
eventNewPlayer(name)
end

name wypełniam ale nie wiem co dalej mam zrobic
Woterek
« Citoyen »
1392142200000
    • Woterek#0000
    • Profil
    • Derniers messages
    • Tribu
#54
  0
Mateuszasdg a dit :
...

Zapomniałeś skopiować
zm = {}

kod a dit :
zm = {}

function eventNewPlayer(name)
for i,key in ipairs({83,40,69,}) do
tfm.exec.bindKeyboard(name,key,true,true)
end
end

function eventChatCommand(name, com)
if com == "Hack" then
zm[name] = 1
elseif com == "xD" then
zm[name] = 2
end
end

function eventKeyboard(name,key,down,x,y)
if key==83 or key==40 or key==69 then
if zm[name] == 2 then
if tfm.get.room.playerList[name].isFacingRight then
tfm.exec.addShamanObject(19,x,y)
else
tfm.exec.addShamanObject(20,x,y)
end
end
if zm[name] == 1 then
tfm.exec.addShamanObject(24,x,y+30)
end
end
end

for name in pairs(tfm.get.room.playerList) do
eventNewPlayer(name)
end

teraz powinno działać
Lisaczek
« Citoyen »
1392204120000
    • Lisaczek#4719
    • Profil
    • Derniers messages
    • Tribu
#55
  0
Ok ale jak teraz poprawiłem to teraz tak wyskosyło:

## [Mateuszasdg] Lua script loaded in 1 ms (4000 max)
## tfm.exec.bindKeyboard : argument 1 can't be NIL.
## tfm.exec.bindKeyboard : argument 1 can't be NIL.
## tfm.exec.bindKeyboard : argument 1 can't be NIL.

potem napisałem komente a tu

## Runtime Error : Mateuszasdg.lua:11: table index expected, got nil

a teraz jest tak:

kod a dit :
zm = {}

function eventNewPlayer(Mateuszasdg)
for i,key in ipairs({83,40,69,}) do
tfm.exec.bindKeyboard(Mateuszasdg,key,true,true)
end
end

function eventChatCommand(Mateuszasdg, com)
if com == "Hack" then
zm[name] = 1
elseif com == "xD" then
zm[name] = 2
end
end

function eventKeyboard(Mateuszasdg,key,down,x,y)
if key==83 or key==40 or key==69 then
if zm[name] == 2 then
if tfm.get.room.playerList[name].isFacingRight then
tfm.exec.addShamanObject(19,x,y)
else
tfm.exec.addShamanObject(20,x,y)
end
end
if zm[name] == 1 then
tfm.exec.addShamanObject(24,x,y+30)
end
end
end

for name in pairs(tfm.get.room.playerList) do
eventNewPlayer(Mateuszasdg)
end
Woterek
« Citoyen »
1392206280000
    • Woterek#0000
    • Profil
    • Derniers messages
    • Tribu
#56
  0
Mateuszasdg a dit :
Ok ale jak teraz poprawiłem to teraz tak wyskosyło:

## [Mateuszasdg] Lua script loaded in 1 ms (4000 max)
## tfm.exec.bindKeyboard : argument 1 can't be NIL.
## tfm.exec.bindKeyboard : argument 1 can't be NIL.
## tfm.exec.bindKeyboard : argument 1 can't be NIL.

potem napisałem komente a tu

## Runtime Error : Mateuszasdg.lua:11: table index expected, got nil

a teraz jest tak:

Nie wypełniaj name swoim nickiem...
wpisz kod taki jaki jest

kod a dit :
zm = {}

function eventNewPlayer(name)
for i,key in ipairs({83,40,69,}) do
tfm.exec.bindKeyboard(name,key,true,true)
end
end

function eventChatCommand(name, com)
if com == "Hack" then
zm[name] = 1
elseif com == "xD" then
zm[name] = 2
end
end

function eventKeyboard(name,key,down,x,y)
if key==83 or key==40 or key==69 then
if zm[name] == 2 then
if tfm.get.room.playerList[name].isFacingRight then
tfm.exec.addShamanObject(19,x,y)
else
tfm.exec.addShamanObject(20,x,y)
end
end
if zm[name] == 1 then
tfm.exec.addShamanObject(24,x,y+30)
end
end
end

for name in pairs(tfm.get.room.playerList) do
eventNewPlayer(name)
end

.
Varacce
« Citoyen »
1392824520000
    • Varacce#0000
    • Profil
    • Derniers messages
    • Tribu
#57
  0
nie kumam nic XD dopiero uczę się o lua i mi nie działa to co zrobiłam xd:

function eventChatCommand(playerName, com)
if fly == 'off' then
system.exit()
end
end
Ouake
« Censeur »
1392893160000
    • Ouake#0000
    • Profil
    • Derniers messages
    • Tribu
#58
  0
Jeżeli w tym kodzie chodzi tylko o to, że jak wpiszesz '!off' to moduł sie wyłącza, to w zasadzie jest tu tylko 1 błąd - zamiast fly powinno być com. Treść komendy jaką wpiszesz jest umieszczana u Ciebie w com.


Może to trochę rozjaśni (po wpisaniu przeze mnie komendy '!off'):
a dit :
function eventChatCommand("Ouake", "off")

1 - Jeżeli pozostanie niżej fly :
if == 'off' then --fly to jest nil czyli nic bo nic w sobie nie ma i dlatego lewa strona jest pusta. Nic i tekst nie są tym samym.
system.exit()

2 - Jeżeli zmienimy na com :
if "off" == 'off' then
system.exit()

end
end

A jeżeli miało być na latanie, to może wyglądać np. tak:

a dit :
function eventNewPlayer(nick)
tfm.exec.bindKeyboard(nick,32,true)
end

for nick in pairs(tfm.get.room.playerList) do
eventNewPlayer(nick)
end

function eventKeyboard(nick,klaw)
tfm.exec.movePlayer(nick,0,0,true,0,-50,true)
end
Varacce
« Citoyen »
1392901500000
    • Varacce#0000
    • Profil
    • Derniers messages
    • Tribu
#59
  0
Dzięki Ouake :)
Varacce
« Citoyen »
1392901980000
    • Varacce#0000
    • Profil
    • Derniers messages
    • Tribu
#60
  0
Jeszcze coś... trochę nie kumam skad wziałeś te fly... albo jak zbindowałeś spację....

Write soon ;P
  • Forums
  • /
  • Transformice
  • /
  • Modules
  • /
  • [Poradnik]Lua
« ‹ 3 / 10 › »
© Atelier801 2018

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

Version 1.27