×

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
1 / 5 › »
Gotowe skrypty LUA
Woterek
« Citoyen »
1388407500000
    • Woterek#0000
    • Profil
    • Derniers messages
    • Tribu
#1
  3
Gotowe skrypty lua

Teleportacja
function eventNewPlayer(name)
system.bindMouse(name, 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


Latanie
function eventNewPlayer(name)
tfm.exec.bindKeyboard(name, 32, false, true)
end

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

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


Przyciąganie
function eventNewPlayer(name)
system.bindMouse(name, true)
end

function eventMouse(name, x, y)
tfm.exec.explosion(x, y, -10, 200, false)
tfm.exec.displayParticle(12, x, y, 0, 0, 0, 0, nil)
end

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


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

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

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


Każdy jest shamanem!
function eventNewPlayer(name)
tfm.exec.setShaman(name)
end

function eventNewGame()
for name in pairs(tfm.get.room.playerList) do
tfm.exec.setShaman(name)
end
end

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


Shaman jest wampirem!

function eventNewGame()
for name in pairs(tfm.get.room.playerList) do
if tfm.get.room.playerList[name].isShaman then
tfm.exec.setVampirePlayer(name)
end
end
end

function eventLoop()
for name in pairs(tfm.get.room.playerList) do
if tfm.get.room.playerList[name].isShaman then
tfm.exec.setVampirePlayer(name)
end
end
end


!mort
function eventChatCommand(name,cmd)
if cmd=="mort" then
tfm.exec.killPlayer(name)
end
end


Respawn
function eventPlayerDied(name)
tfm.exec.respawnPlayer(name)
end


Losowy kolor nicku
for name, player in pairs(tfm.get.room.playerList) do
tfm.exec.setNameColor(name, string.format("%x", math.random(0x000000, 0xFFFFFF)))
end


Losowy gracz staje się wampirem
players = {}

for name,player in pairs(tfm.get.room.playerList) do
table.insert(players,name)
end

tfm.exec.setVampirePlayer(players[math.random(#players)])



Tworzenie drużyn by Fixe
red={}
blue={}
function makeTeams()
local playerList={}
for name,player in pairs(tfm.get.room.playerList) do
table.insert(playerList,name)
end
for i=1,#playerList,1 do
local index=math.random(#playerList)
local name=playerList[index]
if i%2==0 then
table.insert(red,name)
else
table.insert(blue,name)
end
table.remove(playerList,index)
end
end


Ankiety
x = 0
czas1 = 0
system.disableChatCommandDisplay("ankieta", true)
system.disableChatCommandDisplay("usun", true)

function eventChatCommand(name, cmd)
if cmd:sub(0,7) == "ankieta" then
x = 1
ui.addPopup(0, 1, cmd:sub(9), nil, 50, 50, nil)
czas = os.time()
odp1 = 0
odp2 = 0
end
if cmd == "usun" then
ui.removeTextArea(1, nil)
ui.removeTextArea(2, nil)
ui.removeTextArea(3, nil)
end
end

function eventPopupAnswer(id, name, cb)
if cb == "yes" then
odp1 = odp1+1
else
odp2 = odp2+1
end
end

function eventLoop()
if x == 1 then
if czas < (os.time() - 15000) then
if odp1 > odp2 then
ui.addTextArea(1, "Więcej osób zagłosowało na tak!", nil, 50, 50, 0, 0, nil, nil, 0.5)
elseif odp1 < odp2 then
ui.addTextArea(1, "Więcej osób zagłosowało na nie!", nil, 50, 50, 0, 0, nil, nil, 0.5)
elseif odp1 == odp2 then
ui.addTextArea(1, "Głosy były równe!", nil, 50, 50, 0, 0, nil, nil, 0.5)
end
ui.addTextArea(2, odp1.." osób zagłosowało na tak", nil,50, 75, 0, 0, nil, nil, 0.5)
ui.addTextArea(3, odp2.." osób zagłosowało na nie", nil,50, 100, 0, 0, nil, nil, 0.5)
end
end
end
--[[
Aby stworzyć ankieta napisz:
!ankieta *tekst tutaj bedzie pytaniem*
wiec jak wpiszesz:
!ankieta czy lubisz transformice
pojawi sie okienko z pytaniem "czy lubisz transformice" i odpowiedzi tak nie.
Komenda:
!usun
usuwa wszystkie textarea.
Wyniki ankiety pojawiają się po 15 sekundach.
]]


Szczerze mówiąc wzorowałem się troche na Lua Snippets.

Starałem się większość kodów zrobić samemu ale niektóre po prostu skopiowałem z tego wątku.

Jeśli chcecie możecie dawać pomysły na kody które przydałoby się dodać.

Dernière modification le 1410898920000
Nicknamepll
« Citoyen »
1388682600000
    • Nicknamepll#0000
    • Profil
    • Derniers messages
    • Tribu
#2
  0
Śńieg? :P Przydatne :P
Julitaserek
« Citoyen »
1389874560000
    • Julitaserek#0000
    • Profil
    • Derniers messages
#3
  0
-Na chate te kody? O_O
Nicknamepll
« Citoyen »
1389896520000
    • Nicknamepll#0000
    • Profil
    • Derniers messages
    • Tribu
#4
  0
Julitaserek a dit :
-Na chate te kody? O_O

Tak. Kopiujesz kod, piszesz /lua i wklejasz kod
Jufaster
« Citoyen »
1390071420000
    • Jufaster#0000
    • Profil
    • Derniers messages
#5
  1
a dit :
function eventChatCommand(playerName, cm)
if cm == 'score' then
ui.addPopup(0,2,"Podaj ilość punktów:",playerName,300,150,200)
end
end

function eventPopupAnswer(id, playerName, odp)
tfm.exec.setPlayerScore(playerName, odp, false)
end

Skrypt na wybór ilości punktów.
Ouake
« Censeur »
1390074360000
    • Ouake#0000
    • Profil
    • Derniers messages
    • Tribu
#6
  2
Dobra, to ja też coś dam.
a dit :
Własna rotacja map:
Mapy={[Tutaj wpisz kody map]}

tfm.exec.disableAutoNewGame(true)
tfm.exec.newGame(Mapy[math.random(#Mapy)])

function eventLoop(t1,t2)
a=0
for v,stat in pairs(tfm.get.room.playerList) do
if stat.isDead~=true then
a=1
end
end
if a~=1 or t2<1 then
tfm.exec.newGame(Mapy[math.random(#Mapy)])
end
end

 
 

Hasło skryptu:
A=""

has=""..math.random(100,999)
print("<T>Hasło : <VP>"..has)
system.disableChatCommandDisplay(has,true)

function eventChatCommand(nick,komd)
[Komendy dla wszystkich]
if komd==has and A=="" then
A=nick
elseif A==nick then
[Komendy tylko dla admina skryptu]
end
end

 
 

Menu okienkowe:
Menu={
{String tytuł, Int pozX, String str1, String str2, String str3,...},
{String tytuł, Int pozX, String str1, String str2, String str3,...},
{String tytuł, Int pozX, String str1, String str2, String str3,...},
{(...)
}
}

Ekw={}

function Okno(nick,a,b,c,d,e,f)
for i,k in pairs({6590372,922647,3294800}) do
x=math.cos(math.pi*(i-1))-math.floor(i/3)
ui.addTextArea(3*a+i-1,b,nick,c-x,d-x,e,f,k,k,n,true)
end
end

function eventNewPlayer(nick)
for i,k in pairs(Menu) do
if not(Menu[1]) then error("Nie wpisano tytułu dla Menu["..i.."]") end
if not(Menu[2]) then error("Nie podano pozycji x dla Menu["..i.."]") end
if Menu[3] then
Okno(nick,104+i,"<a href='event:"..i.."'>"..k[1],k[2],30)
else
Okno(nick,104+i,"<G>"..k[1],k[2],30)
end
end
end

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

function eventTextAreaCallback(id,nick,odp)
if tonumber(odp)~=n and tonumber(odp)~=0 then
a,b="<p align='center'>","<B><a href='event:"
Ekw[nick]={tonumber(odp),3}
Okno(nick,100,Menu[Ekw[nick][1]][Ekw[nick][2]],150,50,500,300)
Okno(nick,101,a.."1/"..(#Menu[Ekw[nick][1]]-2),150,370,60)
Okno(nick,102,a..b.."ZAM'>Zamknij",530,370,60)
Okno(nick,103,a..b.."-'><",605,370,15)
Okno(nick,104,a..b.."+'>>",635,370,15)
elseif odp=="ZAM" then
for i=300,314 do
ui.removeTextArea(i,nick)
end
end
for v,k in pairs({{"-",Ekw[nick][2]>3,-1},{"+",Ekw[nick][2]<(#Menu[Ekw[nick][1]]),1}}) do
if odp==k[1] and k[2] then
Ekw[nick][2]=Ekw[nick][2]+k[3]
ui.addTextArea(302,Menu[Ekw[nick][1]][Ekw[nick][2]],nick,150,50,500,300,0x324650,0x324650,n,true)
ui.addTextArea(305,a..(Ekw[nick][2]-2).."/"..(#Menu[Ekw[nick][1]]-2),nick,150,370,60,n,0x324650,0x324650,n,true)
end
end
end

Powinno sie przydać niektórym :-), ale pamiętajcie by edytować TYLKO żółte pole i w taki sposób jak tu jest przedstawione.

Dernière modification le 1421697120000
Tasted
« Citoyen »
1392656340000
    • Tasted#0000
    • Profil
    • Derniers messages
    • Tribu
#7
  0
Woterek, jedna rzecz. Kod na losowy kolor nie działa. Daje niestety szary kolorek. :c
Basterfeild
« Citoyen »
1393353600000
    • Basterfeild#0000
    • Profil
    • Derniers messages
#8
  1
a dit :
function eventChatCommand(n,c)
txt = c
end
function eventLoop()
ui.addTextArea(0, "<font size='100'>"..txt.."</font>", nil, 20, 20, 900, 600, nil, nil, 0, false)
end
txt = 0

Po wpisaniu !Tekst wyświetla się on na ekranie.
Szczurb
« Censeur »
1395168000000
    • Szczurb#5147
    • Profil
    • Derniers messages
    • Tribu
#9
  0
Super przydatne :))))
Kiriami
1395600360000
    • Kiriami#0000
    • Profil
    • Derniers messages
    • Tribu
#10
[Modéré par Rekichan]
Rohere
« Consul »
1399109340000
    • Rohere#0000
    • Profil
    • Derniers messages
    • Tribu
#11
  0
Fajny wątek.
Myszkangel
1400231280000
    • Myszkangel#0000
    • Profil
    • Derniers messages
#12
[Modéré par Coska]
Rohere
1400242560000
    • Rohere#0000
    • Profil
    • Derniers messages
    • Tribu
#13
[Modéré par Coska]
Aniolkaa
« Citoyen »
1409160300000
    • Aniolkaa#0000
    • Profil
    • Derniers messages
    • Tribu
#14
  0
Tworzenie drużyn by Fxie a dit :
red={}
blue={}
function makeTeams()
local playerList={}
for name,player in pairs(tfm.get.room.playerList) do
table.insert(playerList,name)
end
for i=1,#playerList,1 do
local index=math.random(#playerList)
local name=playerList[index]
if i%2==0 then
table.insert(red,name)
else
table.insert(blue,name)
end
table.remove(playerList,index)
end
end

a jak sie robi te drużyny?

Dernière modification le 1409160420000
Ewelax
« Citoyen »
1418912220000
    • Ewelax#0000
    • Profil
    • Derniers messages
    • Tribu
#15
  0
Mam pytanko.
Bo jak jest jakiś kod, typu:
function eventNewPlayer(name)
system.bindMouse(name, true)
end

function eventMouse(name, x, y)
tfm.exec.explosion(x, y, -10, 200, false)
tfm.exec.displayParticle(12, x, y, 0, 0, 0, 0, nil)
end

for name in pairs(tfm.get.room.playerList) do
eventNewPlayer(name)
end
To co wpisac bym tylko ja to miała a nie wszyscy? :o
Sakamasek
« Citoyen »
1421851260000
    • Sakamasek#0000
    • Profil
    • Derniers messages
    • Tribu
#16
  1
Wszyscy
Gekon_lamparci
« Citoyen »
1428774240000
    • Gekon_lamparci#0095
    • Profil
    • Derniers messages
    • Tribu
#17
  0
poproszę taki który sprawi że po wpisaniu !vamp ta osoba która to napisała zmienai się w wampira
Graczg
« Citoyen »
1428785700000
    • Graczg#0000
    • Profil
    • Derniers messages
    • Tribu
#18
  0
To chyba nie tu, jak chcesz takie cos to idz na Utility.
Gekon_lamparci
« Citoyen »
1428819540000
    • Gekon_lamparci#0095
    • Profil
    • Derniers messages
    • Tribu
#19
  1
kurcze właśnie mi potrzebne takie do plemka :c
Hypermousem
« Censeur »
1428822960000
    • Hypermousem#0000
    • Profil
    • Derniers messages
    • Tribu
#20
  0
Wielkiogur a dit :
kurcze właśnie mi potrzebne takie do plemka :c

To zamów w wątku "Zamówienia na kody"
  • Forums
  • /
  • Transformice
  • /
  • Modules
  • /
  • Gotowe skrypty LUA
1 / 5 › »
© Atelier801 2018

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

Version 1.27