×

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
  • /
  • Gotowe skrypty LUA
« ‹ 4 / 5 › »
Gotowe skrypty LUA
Rohere
« Consul »
1468144800000
    • Rohere#0000
    • Profil
    • Derniers messages
    • Tribu
#61
  0
Fpekal a dit :
thefryz a dit :
jak się teleportuję

To raczej powinieneś napisać w dziale o uczeniu się LUA a nie gotowych spryptach, ale odpowiem Ci. Służy do tego funkcja "tfm.exec.movePlayer()"

Tutaj jest o tym skrypt, wystarczy nacisnąć aby się teleportować
Polskikoxupl
« Citoyen »
1469015880000
    • Polskikoxupl#0000
    • Profil
    • Derniers messages
#62
  0
Nie za bardzo umiem używać tych komend czy ktoś mi wytłumaczy jak je używać ? :(
Dziedzicuwka
« Citoyen »
1478946120000
    • Dziedzicuwka#0000
    • Profil
    • Derniers messages
    • Tribu
#63
  0
Nikt nie wie XD.

glupawkalol a dit :
Odkryłem to!
MOGĘ POLACZYĆ KODY
1.
Wkleić kod.
2. pod (end) Stawiam 2x linijke
a na drugiej linijce
Wpisuję 2 kod
i polaczone kody

Możesz tak ale ci sie kod zepsuje najlepiej dam ci przykład na serze 1.function a reszta tak
function eventChatCommand(nick,komd)
if komd=="ser" then
tfm.exec.giveCheese(nick)
end
if komd=="shaman" then
tfm.exec.setShaman(nick)
end
end
Super przydatne to :D

Dernière modification le 1481803140000
Marcelowy212
1482862800000
    • Marcelowy212#0000
    • Profil
    • Derniers messages
#66
[Modéré par Mesmera, raison : Spam]
Sebafrancuz
« Consul »
1483201980000
    • Sebafrancuz#0000
    • Profil
    • Derniers messages
    • Tribu
#67
  2
Jeżeli ktoś chce zrobić coś na sylwestra (odliczanie 10 ostatnich sekund):
kod

Code Lua

1
2
3
4
5
6
7
8
9
function eventLoop()
if tonumber(os.date("%Y")) == 2016 and tonumber(os.date("%m"))==12 and tonumber(os.date("%d"))==31 and tonumber(os.date("%H"))==23 and tonumber(os.date("%M"))==59 then
if tonumber(os.date("%S")) >=50 then
ui.addTextArea(1,"<R><B><font size='120'>"..(60-tonumber(os.date("%S"))).."</font></B></R>", nil, 300,100,n,n,0.0,0.0,0.0,true)
end
elseif tonumber(os.date("%Y")) == 2017 then
--coś co ma się dziać po odliczaniu, już w 2017 roku :D
end
end


Możecie sobie dodać przykładowo:

kod

Code Lua

1
2
3
4
5
6
7
8
9
function eventLoop()
if tonumber(os.date("%Y")) == 2016 and tonumber(os.date("%m"))==12 and tonumber(os.date("%d"))==31 and tonumber(os.date("%H"))==23 and tonumber(os.date("%M"))==59 then
if tonumber(os.date("%S")) >=50 then
ui.addTextArea(1,"<R><B><font size='120'>"..(60-tonumber(os.date("%S"))).."</font></B></R>", nil, 300,100,n,n,0.0,0.0,0.0,true)
end
elseif tonumber(os.date("%Y")) == 2017 then
ui.addTextArea(1,"<R><B><font size='70'>HAPPY NEW YEAR!</font></B></R>", nil, 20,100,n,n,0.0,0.0,0.0,true)
end
end


Nieaktualne


Dernière modification le 1483272300000
Didshe
« Consul »
1491037680000
    • Didshe#0000
    • Profil
    • Derniers messages
    • Tribu
#68
  0
Meep, Win, Cheese

mice = {}

tfm.exec.newGame('7041402')

function eventChatCommand(playerName, command)
if command == "meep" then
tfm.exec.giveMeep(playerName)
end

if command == "win" then
tfm.exec.giveVictory(playerName)
end

if command == "cheese" then
tfm.exec.giveCheese(playerName)
end
end


Stworzyłam to niedawno gdy uczyłam się LUA XD
dzk za pomoc Saintgio

No więc ogólnie skrypt polega na tym, że gdy go wpiszemy zmieni nam się mapka, jeśli chcesz zmienić kod mapy która się zmieni wpisz kod w ()
na której możemy dać sobie meepa, serek a później norkę.

Dernière modification le 1491037740000
Sebafrancuz
« Consul »
1491240420000
    • Sebafrancuz#0000
    • Profil
    • Derniers messages
    • Tribu
#69
  1
Pokazuje w okienkach prawie wszystkie funkcje w transformice:
Kod

Code Lua

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
local S_ = {
x = -1,
y = 1,
id = 0,
XML = '<C><P F="1" L="2700" /><Z><S><S m="" L="2750" X="1334" H="14" Y="393" T="12" P="0,0.2,0,0.2,0,0,0,0" /><S m="" L="10" o="324650" H="400" X="-5" Y="200" T="12" P="0,0,0,0.2,0,0,0,0" /><S P="0,0,0,0.2,0,0,0,0" m="" L="10" o="324650" X="2707" Y="201" T="12" H="400" /></S><D><DS Y="368" X="22" /></D><O /></Z></C>',
disables = function ()
for _, dis in next, {'AutoNewGame', 'AfkDeath', 'AutoScore', 'AutoShaman', 'AutoTimeLeft'} do
tfm["exec"]["disable"..dis](true)
end
end,
}

S_["disables"]()
tfm.exec.newGame(S_["XML"])


for i, v in next, {system, tfm["exec"], ui, math, string} do
for functions, id in next, v do
S_["x"] = S_["x"] + 1
S_["id"] = S_["id"] + 1
--print("<B><VP>"..functions.."</VP></B> <N>"..tostring(id))
if S_["x"] == 10 then
S_["y"] = S_["y"] + 1
S_["x"] = 0
end
ui.addTextArea(S_["id"], "<B><VP>"..functions.."</VP></B> <N>"..tostring(id), nil, 300*S_["x"]-100, 30 * S_["y"], nil, nil, 0x000000, 0xffffff, 0.5, false)
end
end
Mawcn
« Citoyen »
1491244860000
    • Mawcn#0000
    • Profil
    • Derniers messages
    • Tribu
#70
  0
offtop
Czemu skrypty wyglądają teraz strasznie skomplikowanie jak się je wrzuca na forum?
Rohere
« Consul »
1491245340000
    • Rohere#0000
    • Profil
    • Derniers messages
    • Tribu
#71
  0
Mawcn a dit :
offtop
Czemu skrypty wyglądają teraz strasznie skomplikowanie jak się je wrzuca na forum?

Są trzy powody:

1.Gracze chcą aby wyglądało skomplikowanie

2.Graczom nie chce się pisać 200 linijek, więc stosują trudniejszą metodę i skracają do 50

3.Chore zamówienia :P

Albo dopiero zacząłeś i nic nie kojarzysz

Dernière modification le 1491245400000
Sebafrancuz
« Consul »
1493550300000
    • Sebafrancuz#0000
    • Profil
    • Derniers messages
    • Tribu
#72
  2
Ćwiczyłem sobie funkcje string i wyszło takie coś:
Code Lua

1
2
3
4
5
6
7
8
9
function eventChatCommand(p,k)
if k:sub(0,4) == "kill" then
for player in next, tfm.get.room.playerList do
for players in string.gmatch(k:sub(6), player.."+".."%s-") do
tfm.exec.killPlayer(players)
end
end
end
end

Zabija wszystkich graczy którzy są wpisani po kolei w komendzie, np.
!kill Sebafrancuz Ouake - zabija mnie (Sebafrancuz) i Ouake
!kill Sebafrancuz 0 zabija mnie
!kill Sebafrancuz Ouake Ktosiek - Zabija mnie, Ouake i Ktosiek
Annaxd1
« Censeur »
1503512340000
    • Annaxd1#0000
    • Profil
    • Derniers messages
#73
  0
Zna ktoś kod lua na losowanie w chatce?
Smutny_nalesnik
« Consul »
1503526320000
    • Smutny_nalesnik#0000
    • Profil
    • Derniers messages
    • Tribu
#74
  0
Przydatne.^^
Siemaneczqoo
« Citoyen »
1504281960000
    • Siemaneczqoo#0000
    • Profil
    • Derniers messages
#75
  0
Nicknamepll a dit :
Śńieg? :P Przydatne :P

/neige

To żadne problem wystarczy wpisać na chatcie :P
Rohere
« Consul »
1504283760000
    • Rohere#0000
    • Profil
    • Derniers messages
    • Tribu
#76
  0
Siemaneczqoo a dit :
Nicknamepll a dit :
Śńieg? :P Przydatne :P

/neige

To żadne problem wystarczy wpisać na chatcie :P

Ale ten śnieg z lua trwa wyznaczoną ilość czasu, doczytaj się.
Siemaneczqoo
« Citoyen »
1504436760000
    • Siemaneczqoo#0000
    • Profil
    • Derniers messages
#77
  0
Rohere a dit :
Siemaneczqoo a dit :
Nicknamepll a dit :
Śńieg? :P Przydatne :P

/neige

To żadne problem wystarczy wpisać na chatcie :P

Ale ten śnieg z lua trwa wyznaczoną ilość czasu, doczytaj się.

a to sorry
Dyziek
« Citoyen »
1511710380000
    • Dyziek#5797
    • Profil
    • Derniers messages
    • Tribu
#78
  0
Jak zrobić by jedna osoba dostała tp ?
Rkubi
« Censeur »
1511710920000
    • Rkubi#0000
    • Profil
    • Derniers messages
    • Tribu
#79
  1
Dyzloxd a dit :
Jak zrobić by jedna osoba dostała tp ?

Bazując na kodzie Woterka z tego wątku:

Woterek a dit :
adm = "NICK TEJ JEDNEJ OSOBY"

function eventNewPlayer(name)
system.bindMouse(adm, true)
end

function eventMouse(name, x, y)
tfm.exec.movePlayer(name, x, y, false, 0, 1, false)
tfm.exec.displayParticle(37, x, y, 0, 0, 0, 0, nil)
end

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

Na przykład:
a dit :
adm = "Rkubi"


Dernière modification le 1511711040000
  • Forums
  • /
  • Transformice
  • /
  • Modules
  • /
  • Gotowe skrypty LUA
« ‹ 4 / 5 › »
© Atelier801 2018

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

Version 1.27