×

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
  • /
  • zamówienia na kody.
« ‹ 3 / 149 › »
zamówienia na kody.
Woterek
« Citoyen »
1382992080000
    • Woterek#0000
    • Profil
    • Derniers messages
    • Tribu
#41
  0
Nicknamepll a dit :
Można jeszcze raz?
Jeśli tak to chciał bym kod na Dwa skoki Np klikne dwa razy Strzałke to mysz skacze mi 2 razy.

kod a dit :

function eventNewPlayer(name)
tfm.exec.bindKeyboard(name,38,true,true)
end

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

a = 0

function eventKeyboard(name,key,down,x,y)
if key == 38 and a == 1 then
if tfm.get.room.playerList[name].isJumping then
tfm.exec.movePlayer(name,0,0,true,0,-4,true)
a = 0
end
end
end

function eventLoop()
if a == 0 then
a = 1
end
end

Tylko takie cos udalo mi sie zrobic (dziala tylko na strzalkę)
Da sie to napewno lepiej zrobic bez binda ale nie wiem jak ;/
Basterfeild
« Citoyen »
1383054300000
    • Basterfeild#0000
    • Profil
    • Derniers messages
#42
  0
Pamiętasz jeszcze tamten skrypt?

Zamiast "nick", wystarczyło dać "playerName". Mi tak poszło.
Debests
« Citoyen »
1383473880000
    • Debests#0000
    • Profil
    • Derniers messages
#43
  0
Moge taki kod ze jak sie napisze !sham to bedzie sie szamem a jak !mouse to myszka?
Aanguson
« Citoyen »
1383476580000
    • Aanguson#8461
    • Profil
    • Derniers messages
#44
  0
Debests a dit :
Moge taki kod ze jak sie napisze !sham to bedzie sie szamem a jak !mouse to myszka?

Nie można z szamana zmienić się w normalną mysz. Jedynie reset mapy może to zmienić.


Woterek a dit :
Nie da się tak zrobić bo shaman zamieniony w myszke ma dalej swoje moce

Pierwszy =P
Woterek
« Citoyen »
1383476820000
    • Woterek#0000
    • Profil
    • Derniers messages
    • Tribu
#45
  0
Debests a dit :
Moge taki kod ze jak sie napisze !sham to bedzie sie szamem a jak !mouse to myszka?

Nie da się tak zrobić bo shaman zamieniony w myszke ma dalej swoje moce
Aanguson
« Citoyen »
1383479280000
    • Aanguson#8461
    • Profil
    • Derniers messages
#46
  0
Ma ktoś kod na rotacje map XML i żeby losowo byly odtwarzane.
Ouake
« Censeur »
1383483480000
    • Ouake#0000
    • Profil
    • Derniers messages
    • Tribu
#47
  0
a dit :
  •Aanguson:
mapy={'0','1','2'}

tfm.exec.disableAutoNewGame(true)

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

Zamiast map 0, 1 i 2 wystarczy wpisać swoje kody XML, dla ułatwienia można zrobić to tak:

M1='<C>(...)</C>
M2='<C>(...)</C>
M3='<C>(...)</C>
mapy={M1,M2,M3}
Nicknamepll
« Citoyen »
1383505260000
    • Nicknamepll#0000
    • Profil
    • Derniers messages
    • Tribu
#48
  0
Czy mogę prosić o to że jeśli wpisze komende '!ban ...nick' To dana myszka zostanie zabijana na początek mapy
Woterek
« Citoyen »
1383505740000
    • Woterek#0000
    • Profil
    • Derniers messages
    • Tribu
#49
  0
Nicknamepll a dit :
Czy mogę prosić o to że jeśli wpisze komende '!ban ...nick' To dana myszka zostanie zabijana na początek mapy

kod a dit :
ban={}

for name in pairs(tfm.get.room.playerList) do
ban[name] = 0
end

function eventNewPlayer(name)
ban[name] = 0
end


function eventChatCommand(name, com)
if string.match(com, 'ban .+')then
local nick = string.match(com, 'ban (.+)')
ban[name] = 1
end
end

function eventNewGame()
for name in pairs(tfm.get.room.playerList) do
if ban[name] == 1 then
tfm.exec.killPlayer(name)
end
end
end

;)
Nicknamepll
« Citoyen »
1383677040000
    • Nicknamepll#0000
    • Profil
    • Derniers messages
    • Tribu
#50
  0
Jest ktoś miły i da mi kod na Strzelanie Cn za pomocą strzałki w dół i "S"
Woterek
« Citoyen »
1383678180000
    • Woterek#0000
    • Profil
    • Derniers messages
    • Tribu
#51
  0
Nicknamepll a dit :
Jest ktoś miły i da mi kod na Strzelanie Cn za pomocą strzałki w dół i "S"

http://pastebin.com/3jffgYAg
Nicknamepll
« Citoyen »
1383678720000
    • Nicknamepll#0000
    • Profil
    • Derniers messages
    • Tribu
#52
  0
A jeszcze raz O latanie za pomocą spacji? Tzn o Latanie i strzelanie w jednym :P
Woterek
« Citoyen »
1383679080000
    • Woterek#0000
    • Profil
    • Derniers messages
    • Tribu
#53
  0
Nicknamepll a dit :
A jeszcze raz O latanie za pomocą spacji? Tzn o Latanie i strzelanie w jednym :P

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

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

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

aaa w jednym chcesz wiec

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

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

function eventKeyboard(name,key,down,x,y)
if key == 32 then
tfm.exec.movePlayer(name,0,0,true,0,-50,true)
elseif key == 83 or key == 40 or key == 69 then
if tfm.get.room.playerList[name].isFacingRight then
tfm.exec.addShamanObject(19,x,y+10)
else
tfm.exec.addShamanObject(20,x,y+10)
end
end
end

Dodalem także y+10 dla przyjemniejszego cn-jumpa oraz strzelania
Aanguson
« Citoyen »
1383682020000
    • Aanguson#8461
    • Profil
    • Derniers messages
#54
  0
a dit :
function eventPlayerWon(name)
ui.addTextArea(0, name.."has won", nil, 400, 50)
end

/\
||

Mógły ktoś dać despawna popupu po 5 sekundach do kodu gdy są 2 popupy. Chodzi mi tylko o despawn tego kodu.
Szel
« Citoyen »
1383733080000
    • Szel#0000
    • Profil
    • Derniers messages
#55
  0
@Aanguson:
Popup jest to objekt który ma przycisk zamknij, nie da się go zamknąć zdalnie,

Chodzi ci pewnie o textarea, do usuwania textarea służy funkcja
a dit :
ui.removeTextArea(Int id, String targetPlayer)

przyda ci się też
a dit :
os.time()

która zwraca ilość milisekund od 1 stycznia 1970 roku

modyfikując twój kod dodamy informacje o czasie kiedy komuniakt się wyświetlił
a dit :
function eventPlayerWon(name)
ui.addTextArea(0, name.."has won", nil, 400, 50)
czas_wygranej = os.time()
end

teraz pozostaje nam tylko sprawdzać czy upłyneło wystarczająco dużo czasu żeby usunąć komunikat
Kożystamy z funkcji
a dit :
eventLoop()

która jest wykonywana co około 0,5 sekundy
a dit :
function eventLoop()
if czas_wygranej < os.time()-1000*5 then -- jeżeli czas_wygranej jest mniejszy od obecnego czasu o 5*1000 milisekund to:
ui.removeTextArea(0, nil) -- usuwa komunikat
end
end

cały kod:
a dit :

czas_wygranej = 0

function eventPlayerWon(name)
ui.addTextArea(0, name.." has won", nil, 400, 50)
czas_wygranej = os.time()
end

function eventLoop()
if czas_wygranej < os.time()-1000*5 then -- jeżeli czas_wygranej jest mniejszy od obecnego czasu o 5*1000 milisekund to:
ui.removeTextArea(0, nil) -- usuwa komunikat
end
end

 
Tomiek
« Citoyen »
1383834600000
    • Tomiek#0000
    • Profil
    • Derniers messages
#56
  0
Da sie zrobić coś takiego że gdzie klikne robi się mała kula z której nie można wyjść?
Serfeuszka
« Consul »
1383846240000
    • Serfeuszka#0000
    • Profil
    • Derniers messages
    • Tribu
#57
  0
kod na strzelenie cannonem poprosze ;w;
Jufaster
« Citoyen »
1383846360000
    • Jufaster#0000
    • Profil
    • Derniers messages
#58
  0
Serfeuszka a dit :
kod na strzelenie cannonem poprosze ;w;

[quote=Skrypt #Deathmatchu]
tfm.exec.disableAutoNewGame(true)
tfm.exec.disableAutoShaman(true)
players={}
toDespawn={}
maps={521833,401421,541917,541928,541936,541943,527935,559634,559644,888052,878047,885641,770600,770656,772172,891472,589736,589800,589708,900012,901062,754380,901337,901411,907870,910078,1190467,1252043,1124380,1016258,1252299,1255902,1256808,986790,1285380,1271249,1255944,1255983,1085344,1273114,1276664,1279258,1286824,1280135,1280342,1284861,1287556,1057753,1196679,1288489,1292983,1298164,1298521,1293189,1296949,1308378,1311136,1314419,1314982,1318248,1312411,1312589,1312845,1312933,1313969,1338762,1339474,1349878,1297154,644588,1351237,1354040,1354375,1362386,1283234,1370578,1306592,1360889,1362753,1408124,1407949,1407849,1343986,1408028,1441370,1443416,1389255,1427349,1450527,1424739,869836,1459902,1392993,1426457,1542824,1533474,1561467,1563534,1566991,1587241,1416119,1596270,1601580,1525751,1582146,1558167,1420943,1466487,1642575,1648013,1646094,1393097,1643446,1545219,1583484,1613092,1627981,1633374,1633277,1633251,1585138,1624034,1616785,1625916,1667582,1666996,1675013,1675316,1531316,1665413,1681719,1699880,1688696,623770,1727243,1531329,1683915,1689533,1738601,3756146,912118,3326933,3722005,3566478,1456622,1357994,1985670,1884075,1708065,1700322,2124484,3699046,2965313,4057963,4019126,3335202,2050466}

function eventNewPlayer(name)
for i,key in ipairs({32,40,83}) do
tfm.exec.bindKeyboard(name,key,true,true)
end
players[name]={
timestamp=os.time(),
offsets={x=2, y=10}
}
end

function eventKeyboard(name,key,down,x,y)
if (key==32 or key==40 or key==83) and not tfm.get.room.playerList[name].isDead and started then
if players[name].timestamp < os.time()-1000 then
local id
if tfm.get.room.playerList[name].isFacingRight then
id=tfm.exec.addShamanObject(19,x+players[name].offsets.x,y+players[name].offsets.y)
else
id=tfm.exec.addShamanObject(20,x+players[name].offsets.x,y+players[name].offsets.y)
end
players[name].timestamp=os.time()
table.insert(toDespawn,{os.time(),id})
end
end
end

function eventChatCommand(name,command)
local arg={}
for argument in command:gmatch("[^%s]+") do
table.insert(arg,argument)
end
if arg[1]=="off" then
if tonumber(arg[2]) and tonumber(arg[3]) then
players[name].offsets.x=tonumber(arg[2])
players[name].offsets.y=tonumber(arg[3])
else
players[name].offsets.x=2
players[name].offsets.y=10
end
tfm.exec.chatMessage("Offsets changed to X:"..players[name].offsets.x.." Y:"..players[name].offsets.y,name)
end
end

function eventNewGame()
started=false
end

function eventLoop(time,remaining)
if time >= 3000 and not started then
started=true
end
if remaining<=0 then
tfm.exec.newGame(maps[math.random(#maps)])
end
for i,cannon in ipairs(toDespawn) do
if cannon[1] <= os.time()-3000 then
tfm.exec.removeObject(cannon[2])
table.remove(toDespawn,i)
end
end
end

function eventPlayerDied(name)
local i=0
local n
for pname,player in pairs(tfm.get.room.playerList) do
if not player.isDead then
i=i+1
n=pname
end
end
if i==0 then
tfm.exec.newGame(maps[math.random(#maps)])
elseif i==1 then
tfm.exec.giveCheese(n)
tfm.exec.playerVictory(n)
tfm.exec.setGameTime(5)
end
end

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

tfm.exec.newGame(maps[math.random(#maps)])
[/quote]
Serfeuszka
« Consul »
1383846480000
    • Serfeuszka#0000
    • Profil
    • Derniers messages
    • Tribu
#59
  0
ale to raczej nie działa bo jest masa ampów, nie chcę od razu na czas itd tylko na strzelanie :///
Jufaster
« Citoyen »
1383846480000
    • Jufaster#0000
    • Profil
    • Derniers messages
#60
  0
Serfeuszka a dit :
ale to raczej nie działa bo jest masa ampów, nie chcę od razu na czas itd tylko na strzelanie :///

Już poprawione :P
  • Forums
  • /
  • Transformice
  • /
  • Modules
  • /
  • zamówienia na kody.
« ‹ 3 / 149 › »
© Atelier801 2018

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

Version 1.27