×

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
  • /
  • Script Requests
« ‹ 11 / 160 › »
Script Requests
Shamousey
« Consul »
1382224860000
    • Shamousey#0095
    • Profil
    • Derniers messages
    • Tribu
#201
  0
Bethdacat a dit :
Then i'll request give cheese at 20 seconds

function eventLoop(time,remaining)
if time>=20000 and not cheese then
for n,p in pairs(tfm.get.room.playerList) do
tfm.exec.giveCheese(n)
end
cheese=true
end
end

function eventNewGame()
cheese=nil
end
Jordy
« Consul »
1382225100000
    • Jordy#0015
    • Profil
    • Derniers messages
    • Tribu
#202
  1
Oh damn you. I was trying it as well but this is what I got. xD

a dit :

timer = 0
timerCalc = 47

function eventLoop (timeC, timeR)
timer = timer + 1
if timerCalc == timer then
delayedTimer()
timerCalc = timerCalc + 47
end
print(timer)
end

function eventNewGame()
timer = 0
end

-- This function gets called each 20 seconds!
function delayedTimer()
for name,player in pairs(tfm.get.room.playerList) do
tfm.exec.giveCheese(name)
end
end

tfm.exec.newGame("#1")
Eliaseeg
« Citoyen »
1382226900000
    • Eliaseeg#0000
    • Profil
    • Derniers messages
#203
  0
I need the latest mouse left , get cheese q_q
Safwanrockz
« Censeur »
1382261460000
    • Safwanrockz#0095
    • Profil
    • Derniers messages
    • Tribu
#204
  0
Eliaseeg a dit :
I need the latest mouse left , get cheese q_q

Latest what? Please explain ty.
Mymicemy
« Citoyen »
1382263500000
    • Mymicemy#0000
    • Profil
    • Derniers messages
    • Tribu
#205
  0
Give cheese to player with command !cheese PlayerName e.e
Safwanrockz
« Censeur »
1382267220000
    • Safwanrockz#0095
    • Profil
    • Derniers messages
    • Tribu
#206
  0
Mymicemy a dit :
Give cheese to player with command !cheese PlayerName e.e

Here you go o/
a dit :
function eventChatCommand(name,cmd)
local arg={}
for argument in cmd:gmatch("[^%s]+") do
table.insert(arg, argument);
end
if arg[1]=="cheese" then
tfm.exec.giveCheese(arg[2])
end
end

 
Issey
« Citoyen »
1382269800000
    • Issey#0000
    • Profil
    • Derniers messages
#207
  0
Eliaseeg a dit :
I need the latest mouse left , get cheese q_q

a dit :
function eventLoop(ct,tr)
i=0
for name in pairs(tfm.get.room.playerList)
i=i+1
end
if i==1 then
for name in pairs(tfm.get.room.playerList)
if(tfm.get.room.playerList[name].isDead==false) then
tfm.exec.giveCheese(name)
end
end
end
end

Not tested, ok? Ok.
Safwanrockz
« Censeur »
1382269920000
    • Safwanrockz#0095
    • Profil
    • Derniers messages
    • Tribu
#208
  0
Issey a dit :
Not tested, ok? Ok.

You forgot the do's~
a dit :
function eventLoop(ct,tr)
i=0
for name in pairs(tfm.get.room.playerList) do
i=i+1
end
if i==1 then
for name in pairs(tfm.get.room.playerList) do
if(tfm.get.room.playerList[name].isDead==false) then
tfm.exec.giveCheese(name)
end
end
end
end

 
Eliaseeg
« Citoyen »
1382287080000
    • Eliaseeg#0000
    • Profil
    • Derniers messages
#209
  0
Thanks to all .3. but... I found this on the server BR

function getAlivePlayers()
local alivePlayersInt = 0
local alivePlayers = {}
for i, player in pairs(tfm.get.room.playerList) do
if player.isDead == false then
alivePlayersInt = alivePlayersInt + 1
table.insert(alivePlayers, player)
end
end
return {alivePlayers, alivePlayersInt}
end

function eventPlayerDied(playerName)
alivePlayers = getAlivePlayers()
alivePlayersList = alivePlayers[1]
alivePlayersNum = alivePlayers[2]
if alivePlayersNum == 1 then
winner = alivePlayersList[1].playerName
tfm.exec.giveCheese(winner)
tfm.exec.setPlayerScore(winner, 10, true)
end
end
Zutto
« Citoyen »
1382292720000
    • Zutto#4451
    • Profil
    • Derniers messages
    • Tribu
#210
  1
Someone know a callback to for example:

[?]

When i click the ? show a text of AddText and a botton to Close.

I don't know how do and i want learn
Mymicemy
« Citoyen »
1382294760000
    • Mymicemy#0000
    • Profil
    • Derniers messages
    • Tribu
#211
  0
Safwanrockz a dit :
Here you go o/
function eventChatCommand(name,cmd)
local arg={}
for argument in cmd:gmatch("[^%s]+") do
table.insert(arg, argument);
end
if arg[1]=="cheese" then
tfm.exec.giveCheese(arg[2])
end
end

 

EDIT2: Something terrible wrong with my pc
Safwanrockz
« Censeur »
1382295240000
    • Safwanrockz#0095
    • Profil
    • Derniers messages
    • Tribu
#212
  0
Aritxy a dit :
Someone know a callback to for example:

[?]

When i click the ? show a text of AddText and a botton to Close.

I don't know how do and i want learn

a dit :

ui.addTextArea(0, "<a href='event:help'>?</a>", nil, nil, nil, nil, "0x234c53", "0x234c53", nil)

function eventTextAreaCallback(id,name,cb)
if cb=='help' then
ui.addTextArea(1, "Text here\n<br><br><a href='event:close'>Close</a>", name)
end
if cb=='close' then
ui.removeTextArea(1, name)
end
end

Mymicemy a dit :
You're sure you wrote it right? It's not even loading :(

It's working fine for me you just need to type !cheese PlayerName.
Doneky
« Citoyen »
1382299080000
    • Doneky#0000
    • Profil
    • Derniers messages
    • Tribu
#213
  0
Somebody can help me with script?
a dit :
Jogadores = {}

function eventChatCommand(name, command)
if command == "add" then
ui.addPopup(0,2,"Adicionar jogador na lista 'Jogadores'",name,300,100,200)
end
end

function eventPopupAnswer(id, player, answer)
if id == 0 then
table.insert(Jogadores,answer)
end
end

The command !add will added a player in table Jogadores.
Safwanrockz
« Censeur »
1382299740000
    • Safwanrockz#0095
    • Profil
    • Derniers messages
    • Tribu
#214
  0
Doneky a dit :
Somebody can help me with script?


The command !add will added a player in table Jogadores.

And what's wrong about it?
Doneky
« Citoyen »
1382302200000
    • Doneky#0000
    • Profil
    • Derniers messages
    • Tribu
#215
  0
Safwanrockz a dit :
And what's wrong about it?

Don't is being added a player in table.
Shamousey
« Consul »
1382304120000
    • Shamousey#0095
    • Profil
    • Derniers messages
    • Tribu
#216
  0
Doneky a dit :
Don't is being added a player in table.

This adds things to the table just fine. What are you using to test it?
Doneky
« Citoyen »
1382306400000
    • Doneky#0000
    • Profil
    • Derniers messages
    • Tribu
#217
  0
Shamousey a dit :
This adds things to the table just fine. What are you using to test it?

A command that only players that is in table can to use.
Shamousey
« Consul »
1382308980000
    • Shamousey#0095
    • Profil
    • Derniers messages
    • Tribu
#218
  0
Doneky a dit :
A command that only players that is in table can to use.

It must be that command that's wrong, because the code you posted above works fine.
Doneky
« Citoyen »
1382316660000
    • Doneky#0000
    • Profil
    • Derniers messages
    • Tribu
#219
  0
Shamousey a dit :
It must be that command that's wrong, because the code you posted above works fine.

hm.. Look this here:
a dit :
admins = {Doneky = true}

function eventChatCommand(name, command)
if admins[name] == true then
if command == "cheese" then
ui.addPopup(0,2,"Dar queijo para:",name,300,100,200)

elseif command == "matar" then
ui.addPopup(1,2," Matar o Jogador:",name,300,100,200)

elseif command == "vamp" then
ui.addPopup(2,2,"Transformar em vampiro:",name,300,100,200)

elseif command == "add" then
ui.addPopup(3,2,"Dar admin para:",name,300,200,100)
end
end
end

function eventPopupAnswer(id, name, answer)
if id == 0 then
tfm.exec.giveCheese(answer)

elseif id == 1 then
tfm.exec.killPlayer(answer)

elseif id == 2 then
tfm.exec.setVampirePlayer(answer)

elseif id == 3 then
table.insert(admins,answer)
print("Jogador adicionado a tabela <r>admins</r>.")
end
end

Why is wrong?
Issey
« Citoyen »
1382317920000
    • Issey#0000
    • Profil
    • Derniers messages
#220
  0
Doneky a dit :
hm.. Look this here:

Why is wrong?

replace table.insert(admins,answer) with admins[answer]=true
  • Forums
  • /
  • Transformice
  • /
  • Modules
  • /
  • Script Requests
« ‹ 11 / 160 › »
© Atelier801 2018

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

Version 1.27