×

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.
« ‹ 140 / 149 › »
zamówienia na kody.
Mlekowaty
« Consul »
1514743740000
    • Mlekowaty#4870
    • Profil
    • Derniers messages
    • Tribu
#2781
  0
Da ktoś wisielca?
Martakiko
« Citoyen »
1514818680000
    • Martakiko#0000
    • Profil
    • Derniers messages
#2782
  0
Sebafrancuz a dit :
Osicat a dit :
Jak sprawdzic czy zostala juz tylko jedna myszka? Z gory dzieki

Kod
Code Lua

1
2
3
4
5
6
7
8
9
function aAliveMouse()
local aMouse = 0;
for index, value in next, tfm.get.room.playerList do
if (not(value.isDead)) then
aMouse = aMouse + 1;
end
end
return aMouse;
end


używasz tej funkcji w warunkach np.
Code Lua

1
2
3
if (aAliveMouse() == 1) then
print("Wow tylko jedna myszka żyje");
end

a jak zrobic zeby na wiadomosc wyswietlil nick tej myszki
Ether
« Citoyen »
1514821920000
    • Ether#7048
    • Profil
    • Derniers messages
    • Tribu
#2783
  0
Kuib555 a dit :
Da ktoś wisielca?

tfm.exec.disableAfkDeath(true)
tfm.exec.disableAutoShaman(true)
tfm.exec.disableAutoNewGame(true)
tfm.exec.disableAutoScore(true)
tfm.exec.disableAutoTimeLeft(true)

chars = {"&","é","~","\"","{","|","è","`","_","à","@","]","+","=","}","¨","ë","ä","ü","ö","£","<",">","0","1","2","3","4","5","6","7","8","9","ą","ę","ś","ć","ń","ó","ź","ż","ł"}

lang = {}

lang.fr = {
ask_word = "Définir le mot à trouver",
choose_word = "Choisissez un mot : (entre 2 et 12 caractères inclus, aucun accent)",
more_players = "Vous devez être au moins <font color='#FF0000'>2</font> joueurs pour jouer au pendu.",
next_turn_1 = "Le prochain tour débutera dans ",
next_turn_2 = " seconde(s).",
turn_of_1 = "C'est le tour de ",
turn_of_2 = " ! ",
patientez = "Patientez pendant qu'il choisir son mot...",
word_found = "Le mot a été trouvé !",
word_not_found = "Pas de chance ! Le mot était ",
time_out = "Temps écoulé !",
pass_turn = "Le maître du jeu a passé son tour !",
quit = "Le maître du jeu a quitté !"
}

lang.en = {
ask_word = "Define the word to find",
choose_word = "Choose a word : (between 2 and 12 characters)",
more_players = "You have to be at least <font color='#FF0000'>2</font> players to play Hangman.",
next_turn_1 = "Next turn in ",
next_turn_2 = " second(s).",
turn_of_1 = "It's ",
turn_of_2 = "'s turn ! ",
patientez = "Wait while he's choosing a word...",
word_found = "The word was found !",
word_not_found = "No luck! The word was ",
time_out = "Time out !",
pass_turn = "The game master has passed his turn !",
quit = "The game master has quit."
}
--Przetłumaczone przez Sebafrancuz
lang.pl = {
ask_word = "Zdefiniuj słowo, żeby znaleźć",
choose_word = "Wybierz słowo: (pomiędzy 2 a 12 znakami)",
more_players = "Musi być przynajmniej <font color='#FF0000'>2</font> graczy, żeby grać w Wisielca.",
next_turn_1 = "Następna tura za ",
next_turn_2 = " sekund.",
turn_of_1 = "To ",
turn_of_2 = " tura! ",
patientez = "Czekaj kiedy mistrz gry wybiera słowo...",
word_found = "Słowo zostało odnalezione !",
word_not_found = "Nie masz szczęścia! Słowo to ",
time_out = "Koniec czasu !",
pass_turn = "Mistrz gry poddał swoją turę !",
quit = "Mistrz gry wyszedł."
}

text = lang.pl

players = {}
master = ""

letters = {}
invertLetters = {}

word = ""
hasDefinedWord = false

timer = 0
bestPlayer = ""
pendu_level = 0

beginReset = false
hasToReset = false
resetTimer = 0

isTimeOut = false
hasWon = false
hasLost = false
hasSkipped = false
hasQuit = false

lettersEntered = {}

id = {}

id["ask_word_main"] = 1
id["ask_word_button"] = 2
id["ask_word_popup"] = 3
id["pendu"] = 4
id["reset_timer"] = 5
id["reset_timer_label"] = 6
id["turn"] = 7
id["turn_label"] = 8
id["one_player"] = 9
id["one_player_label"] = 10

function eventNewGame()
updatePlayersList()

ui.removeTextArea(id["one_player"])
ui.removeTextArea(id["one_player_label"])

letters = {}
invertLetters = {}
word = ""
hasDefinedWord = false
timer = 0

if getNbPlayers() > 1 then
master = randomPlayer()
tfm.exec.movePlayer(master, 400, 90, false, 0, 0, false)

askWord()
drawPendu()
else
removeAll()

ui.addTextArea(id["one_player"], "", nil, 5, 110, 790, 25, 0xC0C0C0, 0x595959, 1f)
ui.addTextArea(id["one_player_label"], "<p align='center'><BL><font color='#000000'>"..text.more_players.."</font></p>", nil, 25, 115, 750, 30, 0xC0C0C0, 0xC0C0C0, 0f)

drawWord()
drawPendu()
end
end

function eventPlayerDied(playerName)
tfm.exec.respawnPlayer(playerName)
end

function eventNewPlayer(playerName)
table.insert(players, playerName)

if getNbPlayers() == 2 then
tfm.exec.newGame("@4488917")
else
tfm.exec.respawnPlayer(playerName)
drawWord()
drawPendu()
end
end

function eventPlayerLeft(playerName)
local toRemove = 0

for i,p in pairs(players) do
if p==playerName then
toRemove = i
end
end

table.remove(players, toRemove)

if getNbPlayers() == 1 then
tfm.exec.newGame("@4488917")
else
if playerName==master then
hasQuit = true
reset()
end
end
end

function eventLoop(currentTime, timeRemaining)
timer = timer + 0.5
if beginReset then
ui.removeTextArea(id["ask_word_main"])
ui.removeTextArea(id["ask_word_button"])

resetTimer = resetTimer + 0.5

ui.addTextArea(id["reset_timer"], "", nil, 5, 110, 790, 25, 0xC0C0C0, 0x595959, 1f)
if isTimeOut then ui.addTextArea(id["reset_timer_label"], "<p align='center'><BL>"..text.time_out.." <font color='#000000'>"..text.next_turn_1.."<font color='#FF0000'>"..math.floor(10 - resetTimer).."</font>"..text.next_turn_2.."</font></p>", nil, 25, 115, 750, 30, 0xC0C0C0, 0xC0C0C0, 0f) end
if hasWon then ui.addTextArea(id["reset_timer_label"], "<p align='center'><BL>"..text.word_found.." <font color='#000000'>"..text.next_turn_1.."<font color='#FF0000'>"..math.floor(10 - resetTimer).."</font>"..text.next_turn_2.."</font></p>", nil, 25, 115, 750, 30, 0xC0C0C0, 0xC0C0C0, 0f) end
if hasLost then ui.addTextArea(id["reset_timer_label"], "<p align='center'><font color='#000000'>"..text.word_not_found.."</font><BL>"..word:gsub("^%l", string.upper).."<font color='#000000'> ! "..text.next_turn_1.."<font color='#FF0000'>"..math.floor(10 - resetTimer).."</font>"..text.next_turn_2.."</font></p>", nil, 25, 115, 750, 30, 0xC0C0C0, 0xC0C0C0, 0f) end
if hasSkiped then ui.addTextArea(id["reset_timer_label"], "<p align='center'><BL>"..text.pass_turn.."<font color='#000000'> "..text.next_turn_1.."<font color='#FF0000'>"..math.floor(10 - resetTimer).."</font>"..text.next_turn_2.."</font></p>", nil, 25, 115, 750, 30, 0xC0C0C0, 0xC0C0C0, 0f) end
if hasQuit then ui.addTextArea(id["reset_timer_label"], "<p align='center'><BL>"..text.quit.."<font color='#000000'> "..text.next_turn_1.."<font color='#FF0000'>"..math.floor(10 - resetTimer).."</font>"..text.next_turn_2.."</font></p>", nil, 25, 115, 750, 30, 0xC0C0C0, 0xC0C0C0, 0f) end
end

checkBestPlayer()

if timer==25 and not hasDefinedWord and getNbPlayers() > 1 then
isTimeOut = true
reset()
end

if resetTimer==10 then
isTimeOut = false
hasWon = false
hasLost = false
hasSkiped = false
hasQuit = false

hasToReset = true

reset()
end
end

function eventChatCommand(playerName, message)
local args = {}

for arg in message:gmatch("[^%s]+") do
table.insert(args, arg:lower())
end

if not hasLost and not hasSkiped and not hasQuit and args[1] ~= nil then
if args[1]==word and playerName ~= master and not hasWon then
local score = 0

for _,letter in pairs(letters) do
if letter=="_" then score = score + 1 end
end

tfm.exec.setPlayerScore(playerName, score, true)

local i = 1

while i <= word:len() do
if letters~="_" then
invertLetters = letters
letters = "_"
end

i = i + 1
end

drawWord()
hasWon = true
reset()
end

if args[1]=="skip" and playerName==master and not hasWon and not hasLost and not isTimeOut then
hasSkiped = true
reset()
end

if args[1]:len()==1 and hasDefinedWord and args[1]~= "_" and args[1]~="-" and args[1]~="'" and playerName ~= master then
local isEntered = false

for _,letter in pairs(lettersEntered) do
if letter==args[1] then
isEntered = true
end
end

if not isEntered then
local score = 0
local idsToRemove = {}
local isFalse = true

table.insert(lettersEntered, args[1])

for id,letter in pairs(letters) do
if letter==args[1] then
table.insert(idsToRemove, id)
isFalse = false
end
end

for _,idToRemove in pairs(idsToRemove) do
invertLetters[idToRemove] = letters[idToRemove]
letters[idToRemove] = "_"
end

score = #idsToRemove

if isFalse then
if tfm.get.room.playerList[playerName].score > 0 then score = -1 end
pendu_level = pendu_level + 1
end

tfm.exec.setPlayerScore(playerName, score, true)

drawWord()
drawPendu()
end
end
end
end

function eventTextAreaCallback(textAreaId, playerName, callback)
if callback=="callbackAskWord" then
ui.addPopup(id["ask_word_popup"], 2, text.choose_word, master, 300, 175, 200)
end
end

function eventPopupAnswer(popupId, playerName, answer)
if popupId==id["ask_word_popup"] and not isTimeOut and master==playerName then
local choosedWord = tostring(answer)

if checkWord(choosedWord) then
defineWord(choosedWord)
hasDefinedWord = true

askWord()

ui.removeTextArea(id["turn"])
ui.removeTextArea(id["turn_label"])
end
end
end

function askWord()
ui.removeTextArea(id["reset_timer"])
ui.removeTextArea(id["reset_timer_label"])
ui.removeTextArea(id["ask_word_main"])
ui.removeTextArea(id["ask_word_button"])

if not hasDefinedWord then
ui.addTextArea(id["ask_word_main"], "", master, 5, 110, 790, 35, 0xC0C0C0, 0x595959, 1f)
ui.addTextArea(id["ask_word_button"], "<p align='center'><a href='event:callbackAskWord'>"..text.ask_word.."</a></p>", master, 300, 120, 190, 16, 0x595959, 0x595959, 1f)

for p,_ in pairs(tfm.get.room.playerList) do
if p~=master then
ui.addTextArea(id["turn"], "", p, 5, 110, 790, 25, 0xC0C0C0, 0x595959, 1f)
ui.addTextArea(id["turn_label"], "<p align='center'><font color='#000000'>"..text.turn_of_1.."</font><BL>"..master.."<font color='#000000'>"..text.turn_of_2..text.patientez.."</font></p>", p, 25, 115, 750, 30, 0xC0C0C0, 0xC0C0C0, 0f)
end
end
end
end

function defineWord(new_word)
word = string.lower(string.gsub(new_word, " ", "-"))

letters = {}

local i = 36

while i < 50 do
ui.removeTextArea(i)
i = i + 1
end

for letter in new_word:gmatch"." do
if letter==" " or letter=="-" then
table.insert(invertLetters, "-")
table.insert(letters, "_")
elseif letter=="'" then
table.insert(invertLetters, "'")
table.insert(letters, "_")
else
table.insert(letters, letter:lower())
table.insert(invertLetters, "_")
end
end

drawWord()
drawPendu()
end

function drawWord()
local textId = 36
local i = 1
local ancreX = 40

if #word==0 then
local i = 36

while i < 50 do
ui.removeTextArea(i)
i = i + 1
end
else
while i <= word:len() do
ui.addTextArea(textId, "<p align='center'><font size='40' color='#000000'>"..invertLetters:upper().."</font></p>", nil, ancreX, 150, 40, 60, 0xC0C0C0, 0xC0C0C0, 1f)
ancreX = ancreX + 60
textId = textId + 1
i = i + 1
end

local finished = true
local j = 1

while j <= word:len() do
if invertLetters[j]=="_" then finished = false end
j = j + 1
end

if finished then
hasWon = true
reset()
end
end
end

function drawPendu()
local pendu = ""

if pendu_level==1 then
pendu = pendu.."<br /><br /><br /><br /><br /><br /><br /><br /><br /> _________"

elseif pendu_level==2 then
pendu = pendu.."<br />"
pendu = pendu.." |<br />"
pendu = pendu.." |<br />"
pendu = pendu.." |<br />"
pendu = pendu.." |<br />"
pendu = pendu.." |<br />"
pendu = pendu.." |<br />"
pendu = pendu.." |<br />"
pendu = pendu.." |<br />"
pendu = pendu.." ____|____"

elseif pendu_level==3 then
pendu = pendu.." __________.__<br />"
pendu = pendu.." |<br />"
pendu = pendu.." |<br />"
pendu = pendu.." |<br />"
pendu = pendu.." |<br />"
pendu = pendu.." |<br />"
pendu = pendu.." |<br />"
pendu = pendu.." |<br />"
pendu = pendu.." |<br />"
pendu = pendu.." ____|____"

elseif pendu_level==4 then
pendu = pendu.." __________.__<br />"
pendu = pendu.." | /<br />"
pendu = pendu.." |/<br />"
pendu = pendu.." |<br />"
pendu = pendu.." |<br />"
pendu = pendu.." |<br />"
pendu = pendu.." |<br />"
pendu = pendu.." |<br />"
pendu = pendu.." |<br />"
pendu = pendu.." ____|____"

elseif pendu_level==5 then
pendu = pendu.." __________.__<br />"
pendu = pendu.." | / |<br />"
pendu = pendu.." |/<br />"
pendu = pendu.." |<br />"
pendu = pendu.." |<br />"
pendu = pendu.." |<br />"
pendu = pendu.." |<br />"
pendu = pendu.." |<br />"
pendu = pendu.." |<br />"
pendu = pendu.." ____|____"

elseif pendu_level==6 then
pendu = pendu.." __________.__<br />"
pendu = pendu.." | / |<br />"
pendu = pendu.." |/ O<br />"
pendu = pendu.." |<br />"
pendu = pendu.." |<br />"
pendu = pendu.." |<br />"
pendu = pendu.." |<br />"
pendu = pendu.." |<br />"
pendu = pendu.." |<br />"
pendu = pendu.." ____|____"

elseif pendu_level==7 then
pendu = pendu.." __________.__<br />"
pendu = pendu.." | / |<br />"
pendu = pendu.." |/ O<br />"
pendu = pendu.." | /|<br />"
pendu = pendu.." |<br />"
pendu = pendu.." |<br />"
pendu = pendu.." |<br />"
pendu = pendu.." |<br />"
pendu = pendu.." |<br />"
pendu = pendu.." ____|____"

elseif pendu_level==8 then
pendu = pendu.." __________.__<br />"
pendu = pendu.." | / |<br />"
pendu = pendu.." |/ O<br />"
pendu = pendu.." | /|\<br />"
pendu = pendu.." |<br />"
pendu = pendu.." |<br />"
pendu = pendu.." |<br />"
pendu = pendu.." |<br />"
pendu = pendu.." |<br />"
pendu = pendu.." ____|____"

elseif pendu_level==9 then
pendu = pendu.." __________.__<br />"
pendu = pendu.." | / |<br />"
pendu = pendu.." |/ O<br />"
pendu = pendu.." | /|\\<br />"
pendu = pendu.." | |<br />"
pendu = pendu.." |<br />"
pendu = pendu.." |<br />"
pendu = pendu.." |<br />"
pendu = pendu.." |<br />"
pendu = pendu.." ____|____"

elseif pendu_level==10 then
pendu = pendu.." __________.__<br />"
pendu = pendu.." | / |<br />"
pendu = pendu.." |/ O<br />"
pendu = pendu.." | /|\\<br />"
pendu = pendu.." | |<br />"
pendu = pendu.." | /<br />"
pendu = pendu.." |<br />"
pendu = pendu.." |<br />"
pendu = pendu.." |<br />"
pendu = pendu.." ____|____"

elseif pendu_level==11 then
pendu = pendu.." __________.__<br />"
pendu = pendu.." | / | <br />"
pendu = pendu.." |/ O <br />"
pendu = pendu.." | /|\\ <br />"
pendu = pendu.." | | <br />"
pendu = pendu.." | / \\ <br />"
pendu = pendu.." | <br />"
pendu = pendu.." | <br />"
pendu = pendu.." | <br />"
pendu = pendu.." ____|____"

hasLost = true
reset()
end

ui.addTextArea(id["pendu"], pendu, nil, 323, 235, 135, 138, 0x010101, 0xFFFFFF, 0.5f)
end

function reset()
beginReset = true

if hasToReset then
if getNbPlayers() < 2 then
tfm.exec.newGame("@4488917")
else
letters = {}
invertLetters = {}
word = ""
hasDefinedWord = false
pendu_level = 0
beginReset = false
hasToReset = false
resetTimer = 0
lettersEntered = {}

drawWord()
drawPendu()

local randX = math.random(799)
tfm.exec.movePlayer(master, randX, 385, false, 0, 0, false)

local oldMaster = master

if getNbPlayers()~=1 then
if bestPlayer==oldMaster then
while master==oldMaster do
master = randomPlayer()
end
else
master = bestPlayer
end
else
master = bestPlayer
end

randX = math.random(799)

tfm.exec.movePlayer(master, randX, 90, false, 0, 0, false)
tfm.exec.setPlayerScore(master, 0, false)

timer = 0

askWord()
end
end
end

function removeAll()
ui.removeTextArea(id["ask_word_main"])
ui.removeTextArea(id["ask_word_button"])
ui.removeTextArea(id["ask_word_popup"])
ui.removeTextArea(id["pendu"])
ui.removeTextArea(id["reset_timer"])
ui.removeTextArea(id["reset_timer_label"])
ui.removeTextArea(id["turn"])
ui.removeTextArea(id["turn_label"])
ui.removeTextArea(id["one_player"])
ui.removeTextArea(id["one_player_label"])
end

function checkWord(word_arg)
if word_arg:len() >= 2 and word_arg:len() <= 12 then
for _,c in pairs(chars) do
if string.match(word_arg, c) then
return false
end
end

return true
else
return false
end
end

function checkBestPlayer()
topScore = 0
bestPlayer = randomPlayer()

for name,player in pairs(tfm.get.room.playerList) do
if player.score >= topScore then
topScore = player.score
bestPlayer = name
end
end
end

function getNbPlayers()
return #players
end

function updatePlayersList()
players = {}

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

function randomPlayer()
return players[math.random(1,#players)]
end

for name,player in pairs(tfm.get.room.playerList) do
tfm.exec.setPlayerScore(name, 0, false)
end

updatePlayersList()
bestPlayer = randomPlayer()
tfm.exec.newGame("@4488917")
Mlekowaty
« Consul »
1514824320000
    • Mlekowaty#4870
    • Profil
    • Derniers messages
    • Tribu
#2784
  0
Janwojcik a dit :
Kuib555 a dit :
Da ktoś wisielca?

tfm.exec.disableAfkDeath(true)
tfm.exec.disableAutoShaman(true)
tfm.exec.disableAutoNewGame(true)
tfm.exec.disableAutoScore(true)
tfm.exec.disableAutoTimeLeft(true)

chars = {"&","é","~","\"","{","|","è","`","_","à","@","]","+","=","}","¨","ë","ä","ü","ö","£","<",">","0","1","2","3","4","5","6","7","8","9","ą","ę","ś","ć","ń","ó","ź","ż","ł"}

lang = {}

lang.fr = {
ask_word = "Définir le mot à trouver",
choose_word = "Choisissez un mot : (entre 2 et 12 caractères inclus, aucun accent)",
more_players = "Vous devez être au moins <font color='#FF0000'>2</font> joueurs pour jouer au pendu.",
next_turn_1 = "Le prochain tour débutera dans ",
next_turn_2 = " seconde(s).",
turn_of_1 = "C'est le tour de ",
turn_of_2 = " ! ",
patientez = "Patientez pendant qu'il choisir son mot...",
word_found = "Le mot a été trouvé !",
word_not_found = "Pas de chance ! Le mot était ",
time_out = "Temps écoulé !",
pass_turn = "Le maître du jeu a passé son tour !",
quit = "Le maître du jeu a quitté !"
}

lang.en = {
ask_word = "Define the word to find",
choose_word = "Choose a word : (between 2 and 12 characters)",
more_players = "You have to be at least <font color='#FF0000'>2</font> players to play Hangman.",
next_turn_1 = "Next turn in ",
next_turn_2 = " second(s).",
turn_of_1 = "It's ",
turn_of_2 = "'s turn ! ",
patientez = "Wait while he's choosing a word...",
word_found = "The word was found !",
word_not_found = "No luck! The word was ",
time_out = "Time out !",
pass_turn = "The game master has passed his turn !",
quit = "The game master has quit."
}
--Przetłumaczone przez Sebafrancuz
lang.pl = {
ask_word = "Zdefiniuj słowo, żeby znaleźć",
choose_word = "Wybierz słowo: (pomiędzy 2 a 12 znakami)",
more_players = "Musi być przynajmniej <font color='#FF0000'>2</font> graczy, żeby grać w Wisielca.",
next_turn_1 = "Następna tura za ",
next_turn_2 = " sekund.",
turn_of_1 = "To ",
turn_of_2 = " tura! ",
patientez = "Czekaj kiedy mistrz gry wybiera słowo...",
word_found = "Słowo zostało odnalezione !",
word_not_found = "Nie masz szczęścia! Słowo to ",
time_out = "Koniec czasu !",
pass_turn = "Mistrz gry poddał swoją turę !",
quit = "Mistrz gry wyszedł."
}

text = lang.pl

players = {}
master = ""

letters = {}
invertLetters = {}

word = ""
hasDefinedWord = false

timer = 0
bestPlayer = ""
pendu_level = 0

beginReset = false
hasToReset = false
resetTimer = 0

isTimeOut = false
hasWon = false
hasLost = false
hasSkipped = false
hasQuit = false

lettersEntered = {}

id = {}

id["ask_word_main"] = 1
id["ask_word_button"] = 2
id["ask_word_popup"] = 3
id["pendu"] = 4
id["reset_timer"] = 5
id["reset_timer_label"] = 6
id["turn"] = 7
id["turn_label"] = 8
id["one_player"] = 9
id["one_player_label"] = 10

function eventNewGame()
updatePlayersList()

ui.removeTextArea(id["one_player"])
ui.removeTextArea(id["one_player_label"])

letters = {}
invertLetters = {}
word = ""
hasDefinedWord = false
timer = 0

if getNbPlayers() > 1 then
master = randomPlayer()
tfm.exec.movePlayer(master, 400, 90, false, 0, 0, false)

askWord()
drawPendu()
else
removeAll()

ui.addTextArea(id["one_player"], "", nil, 5, 110, 790, 25, 0xC0C0C0, 0x595959, 1f)
ui.addTextArea(id["one_player_label"], "<p align='center'><BL><font color='#000000'>"..text.more_players.."</font></p>", nil, 25, 115, 750, 30, 0xC0C0C0, 0xC0C0C0, 0f)

drawWord()
drawPendu()
end
end

function eventPlayerDied(playerName)
tfm.exec.respawnPlayer(playerName)
end

function eventNewPlayer(playerName)
table.insert(players, playerName)

if getNbPlayers() == 2 then
tfm.exec.newGame("@4488917")
else
tfm.exec.respawnPlayer(playerName)
drawWord()
drawPendu()
end
end

function eventPlayerLeft(playerName)
local toRemove = 0

for i,p in pairs(players) do
if p==playerName then
toRemove = i
end
end

table.remove(players, toRemove)

if getNbPlayers() == 1 then
tfm.exec.newGame("@4488917")
else
if playerName==master then
hasQuit = true
reset()
end
end
end

function eventLoop(currentTime, timeRemaining)
timer = timer + 0.5
if beginReset then
ui.removeTextArea(id["ask_word_main"])
ui.removeTextArea(id["ask_word_button"])

resetTimer = resetTimer + 0.5

ui.addTextArea(id["reset_timer"], "", nil, 5, 110, 790, 25, 0xC0C0C0, 0x595959, 1f)
if isTimeOut then ui.addTextArea(id["reset_timer_label"], "<p align='center'><BL>"..text.time_out.." <font color='#000000'>"..text.next_turn_1.."<font color='#FF0000'>"..math.floor(10 - resetTimer).."</font>"..text.next_turn_2.."</font></p>", nil, 25, 115, 750, 30, 0xC0C0C0, 0xC0C0C0, 0f) end
if hasWon then ui.addTextArea(id["reset_timer_label"], "<p align='center'><BL>"..text.word_found.." <font color='#000000'>"..text.next_turn_1.."<font color='#FF0000'>"..math.floor(10 - resetTimer).."</font>"..text.next_turn_2.."</font></p>", nil, 25, 115, 750, 30, 0xC0C0C0, 0xC0C0C0, 0f) end
if hasLost then ui.addTextArea(id["reset_timer_label"], "<p align='center'><font color='#000000'>"..text.word_not_found.."</font><BL>"..word:gsub("^%l", string.upper).."<font color='#000000'> ! "..text.next_turn_1.."<font color='#FF0000'>"..math.floor(10 - resetTimer).."</font>"..text.next_turn_2.."</font></p>", nil, 25, 115, 750, 30, 0xC0C0C0, 0xC0C0C0, 0f) end
if hasSkiped then ui.addTextArea(id["reset_timer_label"], "<p align='center'><BL>"..text.pass_turn.."<font color='#000000'> "..text.next_turn_1.."<font color='#FF0000'>"..math.floor(10 - resetTimer).."</font>"..text.next_turn_2.."</font></p>", nil, 25, 115, 750, 30, 0xC0C0C0, 0xC0C0C0, 0f) end
if hasQuit then ui.addTextArea(id["reset_timer_label"], "<p align='center'><BL>"..text.quit.."<font color='#000000'> "..text.next_turn_1.."<font color='#FF0000'>"..math.floor(10 - resetTimer).."</font>"..text.next_turn_2.."</font></p>", nil, 25, 115, 750, 30, 0xC0C0C0, 0xC0C0C0, 0f) end
end

checkBestPlayer()

if timer==25 and not hasDefinedWord and getNbPlayers() > 1 then
isTimeOut = true
reset()
end

if resetTimer==10 then
isTimeOut = false
hasWon = false
hasLost = false
hasSkiped = false
hasQuit = false

hasToReset = true

reset()
end
end

function eventChatCommand(playerName, message)
local args = {}

for arg in message:gmatch("[^%s]+") do
table.insert(args, arg:lower())
end

if not hasLost and not hasSkiped and not hasQuit and args[1] ~= nil then
if args[1]==word and playerName ~= master and not hasWon then
local score = 0

for _,letter in pairs(letters) do
if letter=="_" then score = score + 1 end
end

tfm.exec.setPlayerScore(playerName, score, true)

local i = 1

while i <= word:len() do
if letters~="_" then
invertLetters = letters
letters = "_"
end

i = i + 1
end

drawWord()
hasWon = true
reset()
end

if args[1]=="skip" and playerName==master and not hasWon and not hasLost and not isTimeOut then
hasSkiped = true
reset()
end

if args[1]:len()==1 and hasDefinedWord and args[1]~= "_" and args[1]~="-" and args[1]~="'" and playerName ~= master then
local isEntered = false

for _,letter in pairs(lettersEntered) do
if letter==args[1] then
isEntered = true
end
end

if not isEntered then
local score = 0
local idsToRemove = {}
local isFalse = true

table.insert(lettersEntered, args[1])

for id,letter in pairs(letters) do
if letter==args[1] then
table.insert(idsToRemove, id)
isFalse = false
end
end

for _,idToRemove in pairs(idsToRemove) do
invertLetters[idToRemove] = letters[idToRemove]
letters[idToRemove] = "_"
end

score = #idsToRemove

if isFalse then
if tfm.get.room.playerList[playerName].score > 0 then score = -1 end
pendu_level = pendu_level + 1
end

tfm.exec.setPlayerScore(playerName, score, true)

drawWord()
drawPendu()
end
end
end
end

function eventTextAreaCallback(textAreaId, playerName, callback)
if callback=="callbackAskWord" then
ui.addPopup(id["ask_word_popup"], 2, text.choose_word, master, 300, 175, 200)
end
end

function eventPopupAnswer(popupId, playerName, answer)
if popupId==id["ask_word_popup"] and not isTimeOut and master==playerName then
local choosedWord = tostring(answer)

if checkWord(choosedWord) then
defineWord(choosedWord)
hasDefinedWord = true

askWord()

ui.removeTextArea(id["turn"])
ui.removeTextArea(id["turn_label"])
end
end
end

function askWord()
ui.removeTextArea(id["reset_timer"])
ui.removeTextArea(id["reset_timer_label"])
ui.removeTextArea(id["ask_word_main"])
ui.removeTextArea(id["ask_word_button"])

if not hasDefinedWord then
ui.addTextArea(id["ask_word_main"], "", master, 5, 110, 790, 35, 0xC0C0C0, 0x595959, 1f)
ui.addTextArea(id["ask_word_button"], "<p align='center'><a href='event:callbackAskWord'>"..text.ask_word.."</a></p>", master, 300, 120, 190, 16, 0x595959, 0x595959, 1f)

for p,_ in pairs(tfm.get.room.playerList) do
if p~=master then
ui.addTextArea(id["turn"], "", p, 5, 110, 790, 25, 0xC0C0C0, 0x595959, 1f)
ui.addTextArea(id["turn_label"], "<p align='center'><font color='#000000'>"..text.turn_of_1.."</font><BL>"..master.."<font color='#000000'>"..text.turn_of_2..text.patientez.."</font></p>", p, 25, 115, 750, 30, 0xC0C0C0, 0xC0C0C0, 0f)
end
end
end
end

function defineWord(new_word)
word = string.lower(string.gsub(new_word, " ", "-"))

letters = {}

local i = 36

while i < 50 do
ui.removeTextArea(i)
i = i + 1
end

for letter in new_word:gmatch"." do
if letter==" " or letter=="-" then
table.insert(invertLetters, "-")
table.insert(letters, "_")
elseif letter=="'" then
table.insert(invertLetters, "'")
table.insert(letters, "_")
else
table.insert(letters, letter:lower())
table.insert(invertLetters, "_")
end
end

drawWord()
drawPendu()
end

function drawWord()
local textId = 36
local i = 1
local ancreX = 40

if #word==0 then
local i = 36

while i < 50 do
ui.removeTextArea(i)
i = i + 1
end
else
while i <= word:len() do
ui.addTextArea(textId, "<p align='center'><font size='40' color='#000000'>"..invertLetters:upper().."</font></p>", nil, ancreX, 150, 40, 60, 0xC0C0C0, 0xC0C0C0, 1f)
ancreX = ancreX + 60
textId = textId + 1
i = i + 1
end

local finished = true
local j = 1

while j <= word:len() do
if invertLetters[j]=="_" then finished = false end
j = j + 1
end

if finished then
hasWon = true
reset()
end
end
end

function drawPendu()
local pendu = ""

if pendu_level==1 then
pendu = pendu.."<br /><br /><br /><br /><br /><br /><br /><br /><br /> _________"

elseif pendu_level==2 then
pendu = pendu.."<br />"
pendu = pendu.." |<br />"
pendu = pendu.." |<br />"
pendu = pendu.." |<br />"
pendu = pendu.." |<br />"
pendu = pendu.." |<br />"
pendu = pendu.." |<br />"
pendu = pendu.." |<br />"
pendu = pendu.." |<br />"
pendu = pendu.." ____|____"

elseif pendu_level==3 then
pendu = pendu.." __________.__<br />"
pendu = pendu.." |<br />"
pendu = pendu.." |<br />"
pendu = pendu.." |<br />"
pendu = pendu.." |<br />"
pendu = pendu.." |<br />"
pendu = pendu.." |<br />"
pendu = pendu.." |<br />"
pendu = pendu.." |<br />"
pendu = pendu.." ____|____"

elseif pendu_level==4 then
pendu = pendu.." __________.__<br />"
pendu = pendu.." | /<br />"
pendu = pendu.." |/<br />"
pendu = pendu.." |<br />"
pendu = pendu.." |<br />"
pendu = pendu.." |<br />"
pendu = pendu.." |<br />"
pendu = pendu.." |<br />"
pendu = pendu.." |<br />"
pendu = pendu.." ____|____"

elseif pendu_level==5 then
pendu = pendu.." __________.__<br />"
pendu = pendu.." | / |<br />"
pendu = pendu.." |/<br />"
pendu = pendu.." |<br />"
pendu = pendu.." |<br />"
pendu = pendu.." |<br />"
pendu = pendu.." |<br />"
pendu = pendu.." |<br />"
pendu = pendu.." |<br />"
pendu = pendu.." ____|____"

elseif pendu_level==6 then
pendu = pendu.." __________.__<br />"
pendu = pendu.." | / |<br />"
pendu = pendu.." |/ O<br />"
pendu = pendu.." |<br />"
pendu = pendu.." |<br />"
pendu = pendu.." |<br />"
pendu = pendu.." |<br />"
pendu = pendu.." |<br />"
pendu = pendu.." |<br />"
pendu = pendu.." ____|____"

elseif pendu_level==7 then
pendu = pendu.." __________.__<br />"
pendu = pendu.." | / |<br />"
pendu = pendu.." |/ O<br />"
pendu = pendu.." | /|<br />"
pendu = pendu.." |<br />"
pendu = pendu.." |<br />"
pendu = pendu.." |<br />"
pendu = pendu.." |<br />"
pendu = pendu.." |<br />"
pendu = pendu.." ____|____"

elseif pendu_level==8 then
pendu = pendu.." __________.__<br />"
pendu = pendu.." | / |<br />"
pendu = pendu.." |/ O<br />"
pendu = pendu.." | /|\<br />"
pendu = pendu.." |<br />"
pendu = pendu.." |<br />"
pendu = pendu.." |<br />"
pendu = pendu.." |<br />"
pendu = pendu.." |<br />"
pendu = pendu.." ____|____"

elseif pendu_level==9 then
pendu = pendu.." __________.__<br />"
pendu = pendu.." | / |<br />"
pendu = pendu.." |/ O<br />"
pendu = pendu.." | /|\\<br />"
pendu = pendu.." | |<br />"
pendu = pendu.." |<br />"
pendu = pendu.." |<br />"
pendu = pendu.." |<br />"
pendu = pendu.." |<br />"
pendu = pendu.." ____|____"

elseif pendu_level==10 then
pendu = pendu.." __________.__<br />"
pendu = pendu.." | / |<br />"
pendu = pendu.." |/ O<br />"
pendu = pendu.." | /|\\<br />"
pendu = pendu.." | |<br />"
pendu = pendu.." | /<br />"
pendu = pendu.." |<br />"
pendu = pendu.." |<br />"
pendu = pendu.." |<br />"
pendu = pendu.." ____|____"

elseif pendu_level==11 then
pendu = pendu.." __________.__<br />"
pendu = pendu.." | / | <br />"
pendu = pendu.." |/ O <br />"
pendu = pendu.." | /|\\ <br />"
pendu = pendu.." | | <br />"
pendu = pendu.." | / \\ <br />"
pendu = pendu.." | <br />"
pendu = pendu.." | <br />"
pendu = pendu.." | <br />"
pendu = pendu.." ____|____"

hasLost = true
reset()
end

ui.addTextArea(id["pendu"], pendu, nil, 323, 235, 135, 138, 0x010101, 0xFFFFFF, 0.5f)
end

function reset()
beginReset = true

if hasToReset then
if getNbPlayers() < 2 then
tfm.exec.newGame("@4488917")
else
letters = {}
invertLetters = {}
word = ""
hasDefinedWord = false
pendu_level = 0
beginReset = false
hasToReset = false
resetTimer = 0
lettersEntered = {}

drawWord()
drawPendu()

local randX = math.random(799)
tfm.exec.movePlayer(master, randX, 385, false, 0, 0, false)

local oldMaster = master

if getNbPlayers()~=1 then
if bestPlayer==oldMaster then
while master==oldMaster do
master = randomPlayer()
end
else
master = bestPlayer
end
else
master = bestPlayer
end

randX = math.random(799)

tfm.exec.movePlayer(master, randX, 90, false, 0, 0, false)
tfm.exec.setPlayerScore(master, 0, false)

timer = 0

askWord()
end
end
end

function removeAll()
ui.removeTextArea(id["ask_word_main"])
ui.removeTextArea(id["ask_word_button"])
ui.removeTextArea(id["ask_word_popup"])
ui.removeTextArea(id["pendu"])
ui.removeTextArea(id["reset_timer"])
ui.removeTextArea(id["reset_timer_label"])
ui.removeTextArea(id["turn"])
ui.removeTextArea(id["turn_label"])
ui.removeTextArea(id["one_player"])
ui.removeTextArea(id["one_player_label"])
end

function checkWord(word_arg)
if word_arg:len() >= 2 and word_arg:len() <= 12 then
for _,c in pairs(chars) do
if string.match(word_arg, c) then
return false
end
end

return true
else
return false
end
end

function checkBestPlayer()
topScore = 0
bestPlayer = randomPlayer()

for name,player in pairs(tfm.get.room.playerList) do
if player.score >= topScore then
topScore = player.score
bestPlayer = name
end
end
end

function getNbPlayers()
return #players
end

function updatePlayersList()
players = {}

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

function randomPlayer()
return players[math.random(1,#players)]
end

for name,player in pairs(tfm.get.room.playerList) do
tfm.exec.setPlayerScore(name, 0, false)
end

updatePlayersList()
bestPlayer = randomPlayer()
tfm.exec.newGame("@4488917")

Nie działa, jak wpisuje słowo to wyłącza moduł.
Rkubi
« Censeur »
1515678780000
    • Rkubi#0000
    • Profil
    • Derniers messages
    • Tribu
#2785
  0
Martakiko a dit :
poprosze o kod ze po 5 sekundach pojawi sie wiadomosc popup i zeby odliczalo czas na mapie do wyswietlenia tej wiadomosci

Code Lua

1
2
3
4
5
6
7
8
9
10
11
12
13
  _t = 5
txt = "Tutaj wpisz treść wiadomości Popup"

function eventLoop()
if _t > 0 then
_t = _t - 0.5
ui.addTextArea(0, "<B>Wiadomość Popup pojawi się za "..math.ceil(_t).." sek.</B>", nil, 250, 370, 300, 30, 0x121212, 0x010101, 0.8, true)
elseif _t == 0 then
ui.removeTextArea(0, nil)
ui.addPopup(0, 0, txt, nil, 250, 100, 300, true)
_t = _t - 1
end
end

Dernière modification le 1515679020000
Dziedzicuwka
« Citoyen »
1515772200000
    • Dziedzicuwka#0000
    • Profil
    • Derniers messages
    • Tribu
#2786
  0
ui.showColorPicker
jak tego uzywac
Siemaneczqoo
« Citoyen »
1516637400000
    • Siemaneczqoo#0000
    • Profil
    • Derniers messages
#2787
  0
chciałbym skrypt lua na funcorp w chatce! z Adminem
Rkubi
« Censeur »
1516650360000
    • Rkubi#0000
    • Profil
    • Derniers messages
    • Tribu
#2788
  0
Dziedzicuwka a dit :
ui.showColorPicker
jak tego uzywac

Ta funkcja umożliwia wstawienie palety kolorów, z której można jakiś wybrać.
Przykładowo można tą funkcję wypełnić tak:

a dit :
ui.showColorPicker(1, nil, 0x121212, "TEST")


Jednak aby otrzymać ten wybrany kolor w postaci kodu trzeba skorzystać z eventu eventColorPicked(), który współpracuje w tą funkcją.

Przykładowe zastosowanie tej funkcji wraz z eventem:
Code Lua

1
2
3
4
5
6
  function eventColorPicked(id, nick, color)
local c = string.sub(string.format("%08x",color),3)
tfm.exec.setNameColor(nick, "0x"..c)
end

ui.showColorPicker(1, nil, 0x121212, "TEST")


Siemaneczqoo a dit :
chciałbym skrypt lua na funcorp w chatce! z Adminem

Transformicowe drzewo lua nie jest wyposażone w funkcje umożliwiające podobne działanie do FunCorp, więc za pomocą kodu lua jest to nie możliwe. Jeśli chcesz skorzystać z części tych funkcji możesz to zrobić w pokoju *strm_Siemaneczqoo


Aby poczytać więcej o pokojach strm zobacz tutaj: https://atelier801.com/topic?f=6&t=823447
Coffe_bear
« Citoyen »
1517147040000
    • Coffe_bear#5753
    • Profil
    • Derniers messages
#2789
  0
Poprosiłbym o kod o przyciągnie przedmiotów o ile się da :D
Nikodem62
« Citoyen »
1517237040000
    • Nikodem62#0000
    • Profil
    • Derniers messages
#2790
  0
chciałbym coś takiego jak powers ale inne moce pod innymi klawiszami i żeby było ich więcej
Dziedzicuwka
« Citoyen »
1517571120000
    • Dziedzicuwka#0000
    • Profil
    • Derniers messages
    • Tribu
#2791
  0
Nikodem62 a dit :
chciałbym coś takiego jak powers ale inne moce pod innymi klawiszami i żeby było ich więcej

Nie da się zrobić animacji, mocy chyba też(max 10) da się.
Ether
« Citoyen »
1517578800000
    • Ether#7048
    • Profil
    • Derniers messages
    • Tribu
#2792
  0
Dziedzicuwka a dit :
Nikodem62 a dit :
chciałbym coś takiego jak powers ale inne moce pod innymi klawiszami i żeby było ich więcej

Nie da się zrobić animacji, mocy chyba też(max 10) da się.

Czemu niby max 10?
Nikodem62
« Citoyen »
1517677920000
    • Nikodem62#0000
    • Profil
    • Derniers messages
#2793
  0
no ale że np jak jest w powers jak siekliknie ta kreska to jest animacja?
Fpekal
« Citoyen »
1519678500000
    • Fpekal#0000
    • Profil
    • Derniers messages
    • Tribu
#2794
  1
Dziedzicuwka a dit :
Kocurek694 a dit :
Na utility chciałabym aby po wpisaniu !fire pojawiał się na chwile ogień

LUA działa w chatce.

Jak zrobic żeby jak mam 3 punkty(te w tabelce co sie chodzi z serem do norki)
i wpisuje komende jakaś np .!get i -1000 bierze i żeby nie było -997

Wystarczy najprostszy warunek sprawdzający, czy gracz nie ma mniej niż 0 punktów, a jeżeli ma to ustaw ilość punktów na 0.

czyli:

Code Lua

1
2
3
4
5
for nick, n in pairs(tfm.get.room.playerList) do
if n.score < 0 then
tfm.exec.setPlayerScore(nick, 0)
end
end



Portugalian a dit :
Poprosiłbym o kod o przyciągnie przedmiotów o ile się da :D

Niestety NIE da się ustawić, aby były przyciągane tylko przedmioty. Da się jedynie albo wszystko, albo tylko myszy.


Martakiko a dit :
Sebafrancuz a dit :
Osicat a dit :
Jak sprawdzic czy zostala juz tylko jedna myszka? Z gory dzieki

Kod
Code Lua

1
2
3
4
5
6
7
8
9
function aAliveMouse()
local aMouse = 0;
for index, value in next, tfm.get.room.playerList do
if (not(value.isDead)) then
aMouse = aMouse + 1;
end
end
return aMouse;
end


używasz tej funkcji w warunkach np.
Code Lua

1
2
3
if (aAliveMouse() == 1) then
print("Wow tylko jedna myszka żyje");
end

a jak zrobic zeby na wiadomosc wyswietlil nick tej myszki

Do łączenia łańcuchów znaków używa się dwóch kropek ("..").

Przykładowo chcesz połączyć tekst 'a' i tekst 'b':

Code Lua

1
2
3
4
a = "Hello "
b = "World!"

print(a..b)

Wynik:
Hello World!

Oczywiście gdzieś trzeba było postawić spację.



Samotnik76 a dit :
prosze mi zrobienia takiego modułu ze bedzie jedna myszka ktura bedzie kotem a reszta miyczkami i trzeba uciekac przed kotem jesli kot złapie mysz ta musi wykonac ruchy dawane losowo strzełką na czas jesli nie zdozy muci szekac do kolejnej rundy
strzałki sa te od szamana a kot ma czarny nick a myszki bialy
kot łąpie za pomocą spacji

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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
_data = {}

function eventNewPlayer(nick)
_data[nick] = {
isCat = false,
isCatched = false,
isDead = false,
sequence = {},
timeLeft = 0
}
system.bindKeyboard(nick, 32, true, true)
system.bindKeyboard(nick, 0, true, true)
system.bindKeyboard(nick, 1, true, true)
system.bindKeyboard(nick, 2, true, true)
system.bindKeyboard(nick, 3, true, true)
tfm.exec.setNameColor(nick, 0xFFFFFF)
end

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

function newGame(nickKota)

for nick, n in pairs(_data) do
n.isCat = false
n.isCatched = false
n.isDead = false
n.sequence = {}
n.timeLeft = 0
tfm.exec.setNameColor(nick, 0xFFFFFF)
end

_data[nickKota].isCat = true

tfm.exec.setNameColor(nickKota, 0x111111)
end

function eventKeyboard(nick, key, _, x, y)
if key == 32 and _data[nick].isCat == true then
for nnick, n in pairs(tfm.get.room.playerList) do
if _data[nnick].isCat == false and _data[nnick].isCatched == false and _data[nnick].isDead == false then
if x - 30 < n.x and x + 30 > n.x and y - 30 < n.y and y + 30 > n.y then
_data[nnick].isCatched = true
_data[nnick].timeLeft = 8
for i = 1, 5 do
table.insert(_data[nnick].sequence, math.floor(math.random()*10) % 4)
end
end
end
end
end
if _data[nick].isCatched == true then
if key == 0 or key == 1 or key == 2 or key == 3 then
if _data[nick].sequence[1] == key then
table.remove(_data[nick].sequence, 1)
else
_data[nick].isDead = true
_data[nick].sequence = {}
tfm.exec.killPlayer(nick)
end
if #_data[nick].sequence < 1 then
_data[nick].isCatched = false
_data[nick].timeLeft = 0
end
end
end
end

function eventLoop()
ui.addTextArea(51, "Sript by <font color='#00FFFF'>Fpekal</font>", nil, 700, 380, 100, 20, 0x000000, 0x000000, 0, true)
for nick, n in pairs(_data) do
if n.isCatched == true then
local x = 0
for _, seq in pairs(n.sequence) do
tfm.exec.addShamanObject(0, tfm.get.room.playerList[nick].x - 100 + x * 50, tfm.get.room.playerList[nick].y - 50, 90 + seq * 90, 0, 0, false)
x = x + 1
end
end
if n.timeLeft == 0 and n.isCatched == true then
n.isDead = true
n.isCatched = false
end
if n.timeLeft > 0 then
n.timeLeft = n.timeLeft - 1
if n.timeLeft == 0 then
tfm.exec.killPlayer(nick)
end
end
end
end

function eventPlayerRespawn(nick)
if _data[nick].isDead == true then
tfm.exec.killPlayer(nick)
end
end

function eventChatCommand(nick, com)
local word = {}
for w in com:gmatch("%S+") do
table.insert(word, w)
end
if word[1] == "start" then
local ileMyszy = 0
for _ in pairs(tfm.get.room.playerList) do
ileMyszy = ileMyszy + 1
end
local rand = math.floor(math.random() * 100) % ileMyszy
local i = 0
for nick in pairs(tfm.get.room.playerList) do
if i == rand then
newGame(nick)
end
i = i + 1
end
end
end


Obsługa:

Aby zacząć grę należy wpisać na czacie "!start".

Po rozpoczęciu wybierany jest LOSOWO gracz, który zostaje kotem.

Gdy kot podejdzie do któregoś z innych graczy (który nie jest kotem) i kliknie następnie spację, to danemu graczowi pojawia się nad głową 5 strzałek określających ruch, który mają wykonać, aby się uwolnić. Po poprawnym wpisaniu sekwencji możesz z powrotem normalnie grać, ale gdy wpiszesz ją źle (lub miną, w przybliżeniu, 4 sekundy) to przegrywasz.

MOŻLIWE, że znajdą się jakieś błędy. Nie miałem gdzie i z kim przetestować w boju.

Dernière modification le 1519687740000
Shadow
« Citoyen »
1527528840000
    • Shadow#5397
    • Profil
    • Derniers messages
    • Tribu
#2795
  0
Witajcie, chciałbym kod na tepanie innych (tylko przezemnie) po wpisaniu komendy !tp (tutaj nick gracza którego chce tepnąć w dane miesjce) a po kliknięcie w dane miejsce ten się tam przeteleportuje
Azure_wolf
« Censeur »
1527540720000
    • Azure_wolf#2669
    • Profil
    • Derniers messages
    • Tribu
#2796
  0
możesz użyć do tego utility

czy można stworzyć kod, dzięki któremu po dotknięciu jakiegoś gruntu dodaje nam się punkt na tabeli z punktami? Jeśli tak, to zrobi ktoś?

Dernière modification le 1527544380000
Emenerisqa
« Citoyen »
1527599880000
    • Emenerisqa#0608
    • Profil
    • Derniers messages
#2797
  0
Hej, skoro jest to temat o zamówieniach na kody to czy mogłabym taki że:
Jak się kliknie na mapę np @4942685 pojawiają się fajerwerki i nich gracza ( czyli mój ) : Emenerisqa za pomocą gwiazdek ;) Oczywiście jeśli można to proszę :(
Shadow
« Citoyen »
1527843720000
    • Shadow#5397
    • Profil
    • Derniers messages
    • Tribu
#2798
  0
chciałbym kodzik na to że jeśli wcisne klawisz "o" to wtedy będzie cząsteczka latała za graczem cały czas
Anka8kot
« Censeur »
1527930600000
    • Anka8kot#0000
    • Profil
    • Derniers messages
#2799
  0
Skrypt w grocie na urodziny plemienia
nazwa (tak na przyszłość) : Żywiołowe Myszki

Dernière modification le 1527930660000
Sebafrancuz
« Consul »
1527933180000
    • Sebafrancuz#0000
    • Profil
    • Derniers messages
    • Tribu
#2800
  0
Anka8kot a dit :
Skrypt w grocie na urodziny plemienia
nazwa (tak na przyszłość) : Żywiołowe Myszki

Mapa to nie jest skrypt, zamowienia map sa w innym dziale.
  • Forums
  • /
  • Transformice
  • /
  • Modules
  • /
  • zamówienia na kody.
« ‹ 140 / 149 › »
© Atelier801 2018

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

Version 1.27