×

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
  • /
  • Lua Snippets
« ‹ 9 / 33 › »
Lua Snippets
Mutiya
1380437460000
    • Mutiya#0000
    • Profil
    • Derniers messages
    • Tribu
#161
[Modéré par Whiskypickle, raison : Non-English post]
Abdeltif
« Citoyen »
1380438900000
    • Abdeltif#0000
    • Profil
    • Derniers messages
    • Tribu
#162
  0
a dit :

text1 = "<font color='#ff0000'>Hello there are you ok today ?</font>"
ui.addPopup(1, 2,"" .. text1 .."", playerName, 50, 50, 200)

function eventPopupAnswear(iD, playerName, yes)
if iD==1 and yes=="yes" then
ui.addPopup(2, 0, "good!", playerName, 50, 50, 200)
end
end

I don't get it every thing is right ._.
When i type yes nothing happen huehuehue
Zutto
« Citoyen »
1380444900000
    • Zutto#4451
    • Profil
    • Derniers messages
    • Tribu
#163
  0
nevermind
Abdeltif
« Citoyen »
1380445920000
    • Abdeltif#0000
    • Profil
    • Derniers messages
    • Tribu
#164
  0
Should i ask again please ._.
a dit :

text1 = "<font color='#ff0000'>Hello there are you ok today ?</font>"
ui.addPopup(1, 2,"" .. text1 .."", playerName, 50, 50, 200)

function eventPopupAnswear(iD, playerName, yes)
if iD==1 and yes=="yes" then
ui.addPopup(2, 0, "good!", playerName, 50, 50, 200)
end
end

Don't work correctly , as when i answear the other pop up don't appear
Antoinemaalo
« Citoyen »
1380446280000
    • Antoinemaalo#0000
    • Profil
    • Derniers messages
#165
  0
Abdeltif a dit :
Should i ask again please ._.Don't work correctly , as when i answear the other pop up don't appear

http://pastebin.com/iYk30asU

Indentation is derped here, sorry for Pastebin.
Hophipmice
1380446460000
    • Hophipmice#0000
    • Profil
    • Derniers messages
    • Tribu
#166
[Modéré par Bolinboy, raison : requested]
Makinit
« Citoyen »
1380448500000
    • Makinit#0095
    • Profil
    • Derniers messages
    • Tribu
#167
  0
Hophipmice a dit :
How can you make it that 1 spirit per second?

example a dit :
for name, player in pairs(tfm.get.room.playerList) do
system.bindMouse(name, true)
end

spiritTime = {}
function eventMouse(name, x, y)
local now = os.time()
if not spiritTime[name] or now > spiritTime[name] + 1000 then
tfm.exec.addShamanObject(24, x, y)
spiritTime[name] = now
end
end
Hophipmice
« Citoyen »
1380448740000
    • Hophipmice#0000
    • Profil
    • Derniers messages
    • Tribu
#168
  0
Thanks.
Mete
« Citoyen »
1380449400000
    • Mete#9214
    • Profil
    • Derniers messages
    • Tribu
#169
  0
a dit :
keys={
LEFT=function(name)
minigame.players[name].facing=0
end,
RIGHT=function(name)
minigame.players[name].facing=1
end,
DOWN=function(name,x,y)
local timestamp=tonumber(os.time())
if timestamp-minigame.players[name].cooldown>=1000 then
minigame.players[name].cooldown=timestamp
if minigame.players[name].facing==0 then
tfm.exec.addShamanObject(20,x+2,y+12)
else
tfm.exec.addShamanObject(19,x-2,y+12)
end
end
end
}

why it doesnt working?
Abdeltif
« Citoyen »
1380450660000
    • Abdeltif#0000
    • Profil
    • Derniers messages
    • Tribu
#170
  0
a dit :
function eventChatCommande(playerName, commande)
if commande == "bp" then
tfm.exec.addShamanObject(26, x, y)
end
end

Huehuehue
Why doesn't this work
Thewav
« Citoyen »
1380450780000
    • Thewav#0095
    • Profil
    • Derniers messages
    • Tribu
#171
  0
a dit :

function eventChatCommande(playerName, commande)
if commande == "bp" then
tfm.exec.addShamanObject(26, 400, 200)
end
end

You need to set x and y
Abdeltif
« Citoyen »
1380450900000
    • Abdeltif#0000
    • Profil
    • Derniers messages
    • Tribu
#172
  0
Thewav a dit :
You need to set x and y

Nope it don't work.
Antoooshka
« Citoyen »
1380450900000
    • Antoooshka#0000
    • Profil
    • Derniers messages
#173
  0
Why LUA don't work?

[•] Init Error : 554804
Abdeltif
« Citoyen »
1380451560000
    • Abdeltif#0000
    • Profil
    • Derniers messages
    • Tribu
#174
  0
Lua is such as so fun

http://i.imgur.com/D3FrXntl.png
If you want this coding here :
a dit :
for name, player in pairs(tfm.get.room.playerList) do
system.bindMouse(name, true)
end
function eventMouse(playerName, x, y)
tfm.exec.addShamanObject(23, x, y)
end

Easy :p
Antoinemaalo
« Citoyen »
1380451680000
    • Antoinemaalo#0000
    • Profil
    • Derniers messages
#175
  0
Abdeltif a dit :
Huehuehue
Why doesn't this work

The event is alled eventChatCommand and not eventChatCommande.
Tailtong
« Citoyen »
1380451920000
    • Tailtong#0000
    • Profil
    • Derniers messages
    • Tribu
#176
  0
now that i added math.random to tribes : the minigame, you have more possibilities of destruction
Kirilkiril
« Citoyen »
1380452040000
    • Kirilkiril#0000
    • Profil
    • Derniers messages
#177
  0
What is the script for the drawing tool?
Abdeltif
« Citoyen »
1380452220000
    • Abdeltif#0000
    • Profil
    • Derniers messages
    • Tribu
#178
  0
Fix me this please
a dit :
function eventChatCommand(playerName, commande)
if commande:sub(0,2) == "bp" then
tfm.exec.addShamanObject(26, commande:sub(4), commande:sub(4))
end
end
function eventChatCommand(playerName, commande)
if commande:sub(0,2) == "op" then
tfm.exec.addShamanObject(27, commande:sub(4), commande:sub(4))
end
end

I want !op x y
To put portal in that x y
same for bleu need help ;;
Hophipmice
1380453360000
    • Hophipmice#0000
    • Profil
    • Derniers messages
    • Tribu
#179
[Modéré par Bolinboy, raison : Requested]
Makinit
« Citoyen »
1380453720000
    • Makinit#0095
    • Profil
    • Derniers messages
    • Tribu
#180
  0
Command handling
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
function main()
command.addHandler("commandname", commandfunction)
end

function commandfunction(player, argument1, argument2)
print(player)
print(argument1)
print(argument2)
--do stuff
end

-- command handler
function eventChatCommand(player, message)
local args = string.split(message, "%s")
local text = table.remove(args, 1)
command.handle(string.lower(text), player, args)
end

command = {handlers = {}}
function command.addHandler(text, handler)
if command.handlers[text] == nil then
command.handlers[text] = {}
end
table.insert(command.handlers[text], handler)
end

function command.removeHandler(text, handler)
if command.handlers[text] ~= nil then
local index
for i, h in ipairs(command.handlers[text]) do
if handler == h then
index = i
end
end
if index ~= nil then
table.remove(command.handlers[text], index)
if #command.handlers[text] == 0 then
command.handlers[text] = nil
end
end
end
end
function command.handle(text, player, args)
if command.handlers[text] ~= nil then
for i, handler in ipairs(command.handlers[text]) do
handler(player, unpack(args))
end
end
end
function string.split(str, s)
local res = {};
for part in string.gmatch(str, "[^" .. s .. "]+") do
table.insert(res, part)
end
return res;
end
-- system unpack is unavailable
function unpack (t, i)
i = i or 1
if t[i] ~= nil then
return t[i], unpack(t, i + 1)
end
end

main()

Dernière modification le 1481575380000
  • Forums
  • /
  • Transformice
  • /
  • Modules
  • /
  • Lua Snippets
« ‹ 9 / 33 › »
© Atelier801 2018

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

Version 1.27