×

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] Evento da estufa
[Script] Evento da estufa
Pipocalio
« Citoyen »
1624467120000
    • Pipocalio#0000
    • Profil
    • Derniers messages
    • Tribu
#1
  1
Um amigo meu me pediu pra fazer, como eu tava no tédio mesmo acabei fazendo

script:
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
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
for index, value in next, {'AutoShaman', 'PhysicalConsumables', 'AutoTimeLeft'} do
tfm.exec['disable' .. value](true)
end

tfm.exec.newGame('<C><P D="x_transformice/x_evt/x_evt_27/map-serre.jpg,0,0" Ca="" MEDATA="21,1;;;;-0;0::0,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:1-"/><Z><S><S T="12" X="260" Y="340" L="30" H="50" P="1,0,0.5,0.2,1,1,0,0" o="9d9d9d" c="3" N="" i="-32,-25,x_transformice/x_evt/x_evt_27/pot-feuilles.png"/><S T="0" X="110" Y="390" L="220" H="20" P="0,0,0.3,0.2,0,0,0,0" m=""/><S T="0" X="328" Y="202" L="160" H="20" P="0,0,0.3,0.2,-25,0,0,0" m=""/><S T="12" X="240" Y="320" L="10" H="10" P="1,0,0.3,1,0,0,0,0" o="9d9d9d" c="4" m=""/><S T="12" X="280" Y="320" L="10" H="10" P="1,0,0.3,1,0,0,0,0" o="9d9d9d" c="4" m=""/><S T="12" X="277" Y="340" L="10" H="50" P="1,0,20,0.2,10,1,0,0" o="9d9d9d" c="3" m=""/><S T="12" X="243" Y="340" L="10" H="50" P="1,0,20,0.2,-10,1,0,0" o="9d9d9d" c="3" m=""/><S T="12" X="405" Y="272" L="30" H="50" P="1,0,0.5,0.2,1,1,0,0" o="9d9d9d" c="3" N="" i="-32,-25,x_transformice/x_evt/x_evt_27/pot-feuilles.png"/><S T="12" X="388" Y="272" L="10" H="50" P="1,0,20,0.2,-10,1,0,0" o="9d9d9d" c="3" m=""/><S T="12" X="422" Y="272" L="10" H="50" P="1,0,20,0.2,10,1,0,0" o="9d9d9d" c="3" m=""/><S T="12" X="385" Y="252" L="10" H="10" P="1,0,0.3,1,0,0,0,0" o="9d9d9d" c="2" m=""/><S T="12" X="425" Y="252" L="10" H="10" P="1,0,0.3,1,0,0,0,0" o="9d9d9d" c="4" m=""/><S T="0" X="700" Y="112" L="160" H="20" P="0,0,0.3,0.2,0,0,0,0" c="3" m=""/><S T="0" X="790" Y="250" L="20" H="300" P="0,0,0.3,0.2,0,0,0,0" c="3" m=""/><S T="0" X="715" Y="390" L="40" H="20" P="0,0,0.3,0.2,0,0,0,0" m=""/><S T="12" X="717" Y="82" L="40" H="30" P="0,0,0.5,0.2,0,0,0,0" o="61421b" c="3" m=""/><S T="12" X="530" Y="130" L="30" H="50" P="1,0,0.5,0.2,1,1,0,0" o="9d9d9d" c="3" N="" i="-32,-25,x_transformice/x_evt/x_evt_27/pot-feuilles.png"/><S T="12" X="513" Y="130" L="10" H="50" P="1,0,20,0.2,-10,1,0,0" o="9d9d9d" c="3" m=""/><S T="12" X="547" Y="130" L="10" H="50" P="1,0,20,0.2,10,1,0,0" o="9d9d9d" m=""/><S T="12" X="510" Y="110" L="10" H="10" P="1,0,0.3,1,0,0,0,0" o="9d9d9d" c="4" m=""/><S T="12" X="550" Y="110" L="10" H="10" P="1,0,0.3,1,0,0,0,0" o="9d9d9d" c="4" m=""/><S T="12" X="714" Y="363" L="40" H="30" P="0,0,0.5,0.2,0,0,0,0" o="61421b" c="3" m=""/><S T="12" X="222" Y="207" L="40" H="30" P="0,0,0.5,0.2,0,0,0,0" o="61421b" c="3" m=""/><S T="19" X="565" Y="380" L="40" H="200" P="0,0,0.3,0,0,0,0,0" m=""/><S T="12" X="431" Y="361" L="40" H="30" P="0,0,0.5,0.2,0,0,0,0" o="61421b" c="3" m=""/><S T="0" X="138" Y="187" L="140" H="20" P="0,0,0.3,0.2,45,0,0,0" m=""/><S T="0" X="220" Y="235" L="80" H="20" P="0,0,0.3,0.2,0,0,0,0" m=""/><S T="12" X="82" Y="240" L="30" H="50" P="1,0,0.5,0.2,1,1,0,0" o="9d9d9d" c="3" N="" i="-32,-25,x_transformice/x_evt/x_evt_27/pot-feuilles.png"/><S T="12" X="65" Y="240" L="10" H="50" P="1,0,20,0.2,-10,1,0,0" o="9d9d9d" c="3" m=""/><S T="12" X="99" Y="240" L="10" H="50" P="1,0,20,0.2,10,1,0,0" o="9d9d9d" c="3" m=""/><S T="12" X="62" Y="220" L="10" H="10" P="1,0,0.3,1,0,0,0,0" o="9d9d9d" c="4" m=""/><S T="12" X="102" Y="220" L="10" H="10" P="1,0,0.3,1,0,0,0,0" o="9d9d9d" c="4" m=""/><S T="0" X="430" Y="390" L="140" H="20" P="0,0,0.3,0.2,0,0,0,0" m=""/><S T="12" X="155" Y="363" L="40" H="30" P="0,0,0.5,0.2,0,0,0,0" o="61421b" c="3" m=""/><S T="12" X="142" Y="88" L="40" H="30" P="0,0,0.5,0.2,0,0,0,0" o="61421b" c="3" m=""/><S T="0" X="320" Y="110" L="150" H="20" P="0,0,0.3,0.2,-10,0,0,0" m=""/><S T="0" X="163" Y="104" L="180" H="20" P="0,0,9999,0.2,-20,0,0,0" m=""/><S T="19" X="268" Y="58" L="40" H="160" P="0,0,0.3,0,200,0,0,0" m=""/><S T="0" X="640" Y="370" L="30" H="240" P="0,0,0.3,0.2,0,0,0,0" m=""/><S T="12" X="331" Y="87" L="40" H="30" P="0,0,0.5,0.2,0,0,0,0" o="61421b" c="3" m=""/><S T="12" X="670" Y="185" L="180" H="100" P="0,0,0.3,0.2,0,0,0,0" o="51d451" c="4" m=""/><S T="0" X="-10" Y="320" L="20" H="120" P="0,0,0.3,0.2,0,0,0,0" m=""/><S T="1" X="-10" Y="130" L="20" H="260" P="0,0,0.2,0.2,0,0,0,0" m=""/><S T="0" X="754" Y="385" L="212" H="36" P="0,0,0.3,0.2,0,0,0,0" c="2" m=""/></S><D><DS X="85" Y="367"/></D><O/><L><JPL c="baa07a,2,1,0" M1="3" M2="4" P3="260,245" P4="260,245"/><JR M1="5"/><JR M1="6"/><JR M1="6" M2="3"/><JR M1="5" M2="4"/><JPL c="baa07a,2,1,0" M1="11" M2="10" P3="405,177" P4="405,177"/><JR M1="8" M2="10"/><JR M1="9" M2="11"/><JR M1="7" M2="8"/><JR M1="7" M2="9"/><JR M1="21" M2="22"/><JR M1="21" M2="23"/><JR M1="41" M2="43"/><JR M1="42" M2="44"/><JR M1="40" M2="41"/><JR M1="40" M2="42"/><JR M1="22" M2="24"/><JR M1="23" M2="25"/><JPL c="baa07a,2,1,0" M1="30" M2="31" P3="82,145" P4="82,145"/><JR M1="27" M2="28"/><JR M1="27" M2="29"/><JR M1="28" M2="30"/><JR M1="29" M2="31"/><JPL c="baa07a,2,1,0" M1="19" M2="20" P3="530,20" P4="530,20"/><JR M1="16" M2="17"/><JR M1="16" M2="18"/><JR M1="17" M2="19"/><JR M1="18" M2="20"/></L></Z></C>')

sementes = {"17a34f87990.png", '17a34f89101.png', '17a34f8621e.png'}
flores = {'17a34f8a874.png', '17a34f8bfe6.png', '179c387d3eb.png', '179c3877a19.png', '179c3872ffb.png'} --flor
laranjas = 0
verdes = 0
roxas = 0
brancas = 0
corFlor = 0
terminou = 0

function reset()
vasos={
{x = 140, y = 333, qtdSementes = 0, semente1 = 0, semente2 = 0, imagem = nil},
{x = 417, y = 331, qtdSementes = 0, semente1 = 0, semente2 = 0, imagem = nil},
{x = 701, y = 333, qtdSementes = 0, semente1 = 0, semente2 = 0, imagem = nil},
{x = 208, y = 178, qtdSementes = 0, semente1 = 0, semente2 = 0, imagem = nil},
{x = 126, y = 60, qtdSementes = 0, semente1 = 0, semente2 = 0, imagem = nil},
{x = 316, y = 59, qtdSementes = 0, semente1 = 0, semente2 = 0, imagem = nil},
{x = 704, y = 54, qtdSementes = 0, semente1 = 0, semente2 = 0, imagem = nil}
}
end
local p = {}

local Timer = {timeouts = {}, lastTimeoutId = 0, setTimeout = function(self, callback, timeout)
self.lastTimeoutId = self.lastTimeoutId + 1
self.timeouts[self.lastTimeoutId] = { disabled = false, c = callback, t = timeout}
return self.lastTimeoutId
end}

function atualizatimer()
for k, v in next, Timer.timeouts do
if not v.disabled then
v.t = v.t - 500
if v.t <= 0 then
v.c()
v.disabled = true
end
end
end
end

function premio()
if terminou == 0 then
peixe1 = tfm.exec.addShamanObject(6300, 754, -60, 0, 0, 10)
peixe = tfm.exec.addShamanObject(6300, 754, -20, 0, 0, 10)
tfm.exec.addImage('17a3a20c904.jpg', "#"..peixe, 0, -5, nil)
tfm.exec.addImage('17a3a209a21.jpg', "#"..peixe1, 0, -5, nil)
terminou = 1
laranjas = 0
verdes = 0
roxas = 0
brancas = 0
terminou = 0
end
end

function crescer(vaso, cor1, cor2)
Timer:setTimeout(function()
tfm.exec.removeImage(vasos[vaso].imagem)
if (cor1 == 1 and cor2 == 2 or cor1 == 2 and cor2 == 1) then
vasos[vaso].imagem = tfm.exec.addImage(flores[4], "!1", vasos[vaso].x-7, vasos[vaso].y-30, nil)
verdes = verdes + 1
elseif (cor1 == 2 and cor2 == 3 or cor1 == 3 and cor2 == 2) then
vasos[vaso].imagem = tfm.exec.addImage(flores[5], "!1", vasos[vaso].x-7, vasos[vaso].y-30, nil)
laranjas = laranjas + 1
elseif (cor1 == 1 and cor2 == 3 or cor1 == 3 and cor2 == 1) then
vasos[vaso].imagem = tfm.exec.addImage(flores[3], "!1", vasos[vaso].x-7, vasos[vaso].y-30, nil)
roxas = roxas + 1
elseif cor1 == cor2 then
vasos[vaso].imagem = tfm.exec.addImage(flores[2], "!1", vasos[vaso].x-7, vasos[vaso].y-30, nil)
brancas = brancas + 1 -- -- diz pro jogo que plantaram mais uma planta branca
end
end, 8000)
end

function plantar(player, vaso)
if p[player].mao > 0 then
if vasos[vaso].qtdSementes < 2 then
if vasos[vaso].qtdSementes == 0 then
tfm.exec.addImage(sementes[p[player].mao], "?1", vasos[vaso].x - 5, vasos[vaso].y+27, nil)
vasos[vaso].semente1 = p[player].mao vasos[vaso].qtdSementes = vasos[vaso].qtdSementes + 1
elseif vasos[vaso].qtdSementes == 1 then
vasos[vaso].imagem = tfm.exec.addImage(flores[1], "!1", vasos[vaso].x-7, vasos[vaso].y-30, nil)
tfm.exec.addImage(sementes[p[player].mao], "?1", vasos[vaso].x + 14, vasos[vaso].y+27, nil)
vasos[vaso].semente2 = p[player].mao vasos[vaso].qtdSementes = vasos[vaso].qtdSementes + 1
crescer(vaso, vasos[vaso].semente1, vasos[vaso].semente2)
end
tfm.exec.removeImage(p[player].imagem)
p[player].mao = 0
end
end
end

function eventLoop()
if corFlor == 3 and brancas > 0 and roxas > 0 then
premio()
elseif corFlor == 4 and brancas > 0 and verdes > 0 then
premio()
elseif corFlor == 5 and brancas > 0 and laranjas > 0 then
premio()
end
atualizatimer()
end

function eventNewPlayer(name)
if not p[name] then
p[name] = {
mao = 0,
imagem=0,
}
end
for i,key in ipairs({40,83, 39, 37}) do
tfm.exec.bindKeyboard(name, key, true, true)
end
p[name].mao = math.random(1, 3)
p[name].imagem = tfm.exec.addImage(sementes[p[name].mao], "$"..name, 0, 0, nil)
end

function eventKeyboard(name, key, down, x, y)
if (key == 40 or key == 83) then
if x > 5 and y > 281 and x < 89 and y < 378 then
if p[name].mao == 0 then
semente = math.random(1, 3)
p[name].mao = semente
p[name].imagem = tfm.exec.addImage(sementes[semente], "$"..name, 0, 0, nil)
end
elseif x > 140 and y == 333 and x < 173 then
plantar(name, 1)
elseif x > 415 and y == 331 and x < 451 then
plantar(name, 2)
elseif x > 692 and y == 333 and x < 733 then
plantar(name, 3)
elseif x > 201 and y == 177 and x < 241 then
plantar(name, 4)
elseif x > 121 and y == 58 and x < 160 then
plantar(name, 5)
elseif x > 309 and y == 57 and x < 354 then
plantar(name, 6)
elseif x > 698 and y == 52 and x < 738 then
plantar(name, 7)
end
end
end

function eventNewGame()
reset()
ui.setMapName('<J>Transformice <BL>- @2027')
tfm.exec.newGame('<C><P D="x_transformice/x_evt/x_evt_27/map-serre.jpg,0,0" Ca="" MEDATA="21,1;;;;-0;0::0,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:1-"/><Z><S><S T="12" X="260" Y="340" L="30" H="50" P="1,0,0.5,0.2,1,1,0,0" o="9d9d9d" c="3" N="" i="-32,-25,x_transformice/x_evt/x_evt_27/pot-feuilles.png"/><S T="0" X="110" Y="390" L="220" H="20" P="0,0,0.3,0.2,0,0,0,0" m=""/><S T="0" X="328" Y="202" L="160" H="20" P="0,0,0.3,0.2,-25,0,0,0" m=""/><S T="12" X="240" Y="320" L="10" H="10" P="1,0,0.3,1,0,0,0,0" o="9d9d9d" c="4" m=""/><S T="12" X="280" Y="320" L="10" H="10" P="1,0,0.3,1,0,0,0,0" o="9d9d9d" c="4" m=""/><S T="12" X="277" Y="340" L="10" H="50" P="1,0,20,0.2,10,1,0,0" o="9d9d9d" c="3" m=""/><S T="12" X="243" Y="340" L="10" H="50" P="1,0,20,0.2,-10,1,0,0" o="9d9d9d" c="3" m=""/><S T="12" X="405" Y="272" L="30" H="50" P="1,0,0.5,0.2,1,1,0,0" o="9d9d9d" c="3" N="" i="-32,-25,x_transformice/x_evt/x_evt_27/pot-feuilles.png"/><S T="12" X="388" Y="272" L="10" H="50" P="1,0,20,0.2,-10,1,0,0" o="9d9d9d" c="3" m=""/><S T="12" X="422" Y="272" L="10" H="50" P="1,0,20,0.2,10,1,0,0" o="9d9d9d" c="3" m=""/><S T="12" X="385" Y="252" L="10" H="10" P="1,0,0.3,1,0,0,0,0" o="9d9d9d" c="2" m=""/><S T="12" X="425" Y="252" L="10" H="10" P="1,0,0.3,1,0,0,0,0" o="9d9d9d" c="4" m=""/><S T="0" X="700" Y="112" L="160" H="20" P="0,0,0.3,0.2,0,0,0,0" c="3" m=""/><S T="0" X="790" Y="250" L="20" H="300" P="0,0,0.3,0.2,0,0,0,0" c="3" m=""/><S T="0" X="715" Y="390" L="40" H="20" P="0,0,0.3,0.2,0,0,0,0" m=""/><S T="12" X="717" Y="82" L="40" H="30" P="0,0,0.5,0.2,0,0,0,0" o="61421b" c="3" m=""/><S T="12" X="530" Y="130" L="30" H="50" P="1,0,0.5,0.2,1,1,0,0" o="9d9d9d" c="3" N="" i="-32,-25,x_transformice/x_evt/x_evt_27/pot-feuilles.png"/><S T="12" X="513" Y="130" L="10" H="50" P="1,0,20,0.2,-10,1,0,0" o="9d9d9d" c="3" m=""/><S T="12" X="547" Y="130" L="10" H="50" P="1,0,20,0.2,10,1,0,0" o="9d9d9d" m=""/><S T="12" X="510" Y="110" L="10" H="10" P="1,0,0.3,1,0,0,0,0" o="9d9d9d" c="4" m=""/><S T="12" X="550" Y="110" L="10" H="10" P="1,0,0.3,1,0,0,0,0" o="9d9d9d" c="4" m=""/><S T="12" X="714" Y="363" L="40" H="30" P="0,0,0.5,0.2,0,0,0,0" o="61421b" c="3" m=""/><S T="12" X="222" Y="207" L="40" H="30" P="0,0,0.5,0.2,0,0,0,0" o="61421b" c="3" m=""/><S T="19" X="565" Y="380" L="40" H="200" P="0,0,0.3,0,0,0,0,0" m=""/><S T="12" X="431" Y="361" L="40" H="30" P="0,0,0.5,0.2,0,0,0,0" o="61421b" c="3" m=""/><S T="0" X="138" Y="187" L="140" H="20" P="0,0,0.3,0.2,45,0,0,0" m=""/><S T="0" X="220" Y="235" L="80" H="20" P="0,0,0.3,0.2,0,0,0,0" m=""/><S T="12" X="82" Y="240" L="30" H="50" P="1,0,0.5,0.2,1,1,0,0" o="9d9d9d" c="3" N="" i="-32,-25,x_transformice/x_evt/x_evt_27/pot-feuilles.png"/><S T="12" X="65" Y="240" L="10" H="50" P="1,0,20,0.2,-10,1,0,0" o="9d9d9d" c="3" m=""/><S T="12" X="99" Y="240" L="10" H="50" P="1,0,20,0.2,10,1,0,0" o="9d9d9d" c="3" m=""/><S T="12" X="62" Y="220" L="10" H="10" P="1,0,0.3,1,0,0,0,0" o="9d9d9d" c="4" m=""/><S T="12" X="102" Y="220" L="10" H="10" P="1,0,0.3,1,0,0,0,0" o="9d9d9d" c="4" m=""/><S T="0" X="430" Y="390" L="140" H="20" P="0,0,0.3,0.2,0,0,0,0" m=""/><S T="12" X="155" Y="363" L="40" H="30" P="0,0,0.5,0.2,0,0,0,0" o="61421b" c="3" m=""/><S T="12" X="142" Y="88" L="40" H="30" P="0,0,0.5,0.2,0,0,0,0" o="61421b" c="3" m=""/><S T="0" X="320" Y="110" L="150" H="20" P="0,0,0.3,0.2,-10,0,0,0" m=""/><S T="0" X="163" Y="104" L="180" H="20" P="0,0,9999,0.2,-20,0,0,0" m=""/><S T="19" X="268" Y="58" L="40" H="160" P="0,0,0.3,0,200,0,0,0" m=""/><S T="0" X="640" Y="370" L="30" H="240" P="0,0,0.3,0.2,0,0,0,0" m=""/><S T="12" X="331" Y="87" L="40" H="30" P="0,0,0.5,0.2,0,0,0,0" o="61421b" c="3" m=""/><S T="12" X="670" Y="185" L="180" H="100" P="0,0,0.3,0.2,0,0,0,0" o="51d451" c="4" m=""/><S T="0" X="-10" Y="320" L="20" H="120" P="0,0,0.3,0.2,0,0,0,0" m=""/><S T="1" X="-10" Y="130" L="20" H="260" P="0,0,0.2,0.2,0,0,0,0" m=""/><S T="0" X="754" Y="385" L="212" H="36" P="0,0,0.3,0.2,0,0,0,0" c="2" m=""/></S><D><DS X="85" Y="367"/></D><O/><L><JPL c="baa07a,2,1,0" M1="3" M2="4" P3="260,245" P4="260,245"/><JR M1="5"/><JR M1="6"/><JR M1="6" M2="3"/><JR M1="5" M2="4"/><JPL c="baa07a,2,1,0" M1="11" M2="10" P3="405,177" P4="405,177"/><JR M1="8" M2="10"/><JR M1="9" M2="11"/><JR M1="7" M2="8"/><JR M1="7" M2="9"/><JR M1="21" M2="22"/><JR M1="21" M2="23"/><JR M1="41" M2="43"/><JR M1="42" M2="44"/><JR M1="40" M2="41"/><JR M1="40" M2="42"/><JR M1="22" M2="24"/><JR M1="23" M2="25"/><JPL c="baa07a,2,1,0" M1="30" M2="31" P3="82,145" P4="82,145"/><JR M1="27" M2="28"/><JR M1="27" M2="29"/><JR M1="28" M2="30"/><JR M1="29" M2="31"/><JPL c="baa07a,2,1,0" M1="19" M2="20" P3="530,20" P4="530,20"/><JR M1="16" M2="17"/><JR M1="16" M2="18"/><JR M1="17" M2="19"/><JR M1="18" M2="20"/></L></Z></C>')
corFlor = math.random(3, 5)
tfm.exec.addImage(flores[corFlor], "?1", 596, 160, nil)
for name, player in pairs(tfm.get.room.playerList) do
if p[name] then
tfm.exec.removeImage(p[name].imagem)
end
eventNewPlayer(name)
end
end


*agr com um giveGift falso (KKKK) e arrumei o bug do 4º vaso

Dernière modification le 1625354460000
Pipocalio
« Citoyen »
1624483920000
    • Pipocalio#0000
    • Profil
    • Derniers messages
    • Tribu
#2
  1
Pipocalio a dit :
Um amigo meu me pediu pra fazer, como eu tava no tédio mesmo acabei fazendo

script:
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
119
120
121
for index, value in next, {'AutoShaman', 'PhysicalConsumables', 'MortCommand','AfkDeath', 'AutoNewGame'} do
tfm.exec['disable' .. value]()
end

tfm.exec.newGame('<C><P D="x_transformice/x_evt/x_evt_27/map-serre.jpg,0,0" MEDATA="27,1;;;;-0;0::0,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:1-"/><Z><S><S T="12" X="260" Y="340" L="30" H="50" P="1,0,0.5,0.2,1,1,0,0" o="9d9d9d" c="3" N="" i="-32,-25,x_transformice/x_evt/x_evt_27/pot-feuilles.png"/><S T="0" X="110" Y="390" L="220" H="20" P="0,0,0.3,0.2,0,0,0,0" m=""/><S T="0" X="328" Y="202" L="160" H="20" P="0,0,0.3,0.2,-25,0,0,0" m=""/><S T="12" X="240" Y="320" L="10" H="10" P="1,0,0.3,1,0,0,0,0" o="9d9d9d" c="4" m=""/><S T="12" X="280" Y="320" L="10" H="10" P="1,0,0.3,1,0,0,0,0" o="9d9d9d" c="4" m=""/><S T="12" X="277" Y="340" L="10" H="50" P="1,0,20,0.2,10,1,0,0" o="9d9d9d" c="3" m=""/><S T="12" X="243" Y="340" L="10" H="50" P="1,0,20,0.2,-10,1,0,0" o="9d9d9d" c="3" m=""/><S T="12" X="405" Y="272" L="30" H="50" P="1,0,0.5,0.2,1,1,0,0" o="9d9d9d" c="3" N="" i="-32,-25,x_transformice/x_evt/x_evt_27/pot-feuilles.png"/><S T="12" X="388" Y="272" L="10" H="50" P="1,0,20,0.2,-10,1,0,0" o="9d9d9d" c="3" m=""/><S T="12" X="422" Y="272" L="10" H="50" P="1,0,20,0.2,10,1,0,0" o="9d9d9d" c="3" m=""/><S T="12" X="385" Y="252" L="10" H="10" P="1,0,0.3,1,0,0,0,0" o="9d9d9d" c="2" m=""/><S T="12" X="425" Y="252" L="10" H="10" P="1,0,0.3,1,0,0,0,0" o="9d9d9d" c="4" m=""/><S T="0" X="700" Y="112" L="160" H="20" P="0,0,0.3,0.2,0,0,0,0" m=""/><S T="0" X="790" Y="250" L="20" H="300" P="0,0,0.3,0.2,0,0,0,0" m=""/><S T="0" X="715" Y="390" L="40" H="20" P="0,0,0.3,0.2,0,0,0,0" m=""/><S T="12" X="717" Y="82" L="40" H="30" P="0,0,0.5,0.2,0,0,0,0" o="61421b" c="3" m=""/><S T="12" X="530" Y="130" L="30" H="50" P="1,0,0.5,0.2,1,1,0,0" o="9d9d9d" c="3" N="" i="-32,-25,x_transformice/x_evt/x_evt_27/pot-feuilles.png"/><S T="12" X="513" Y="130" L="10" H="50" P="1,0,20,0.2,-10,1,0,0" o="9d9d9d" c="3" m=""/><S T="12" X="547" Y="130" L="10" H="50" P="1,0,20,0.2,10,1,0,0" o="9d9d9d" m=""/><S T="12" X="510" Y="110" L="10" H="10" P="1,0,0.3,1,0,0,0,0" o="9d9d9d" c="4" m=""/><S T="12" X="550" Y="110" L="10" H="10" P="1,0,0.3,1,0,0,0,0" o="9d9d9d" c="4" m=""/><S T="12" X="714" Y="363" L="40" H="30" P="0,0,0.5,0.2,0,0,0,0" o="61421b" c="3" m=""/><S T="12" X="222" Y="207" L="40" H="30" P="0,0,0.5,0.2,0,0,0,0" o="61421b" c="3" m=""/><S T="19" X="565" Y="380" L="40" H="200" P="0,0,0.3,0,0,0,0,0" m=""/><S T="12" X="431" Y="361" L="40" H="30" P="0,0,0.5,0.2,0,0,0,0" o="61421b" c="3" m=""/><S T="0" X="138" Y="187" L="140" H="20" P="0,0,0.3,0.2,45,0,0,0" m=""/><S T="0" X="220" Y="235" L="80" H="20" P="0,0,0.3,0.2,0,0,0,0" m=""/><S T="12" X="82" Y="240" L="30" H="50" P="1,0,0.5,0.2,1,1,0,0" o="9d9d9d" c="3" N="" i="-32,-25,x_transformice/x_evt/x_evt_27/pot-feuilles.png"/><S T="12" X="65" Y="240" L="10" H="50" P="1,0,20,0.2,-10,1,0,0" o="9d9d9d" c="3" m=""/><S T="12" X="99" Y="240" L="10" H="50" P="1,0,20,0.2,10,1,0,0" o="9d9d9d" c="3" m=""/><S T="12" X="62" Y="220" L="10" H="10" P="1,0,0.3,1,0,0,0,0" o="9d9d9d" c="4" m=""/><S T="12" X="102" Y="220" L="10" H="10" P="1,0,0.3,1,0,0,0,0" o="9d9d9d" c="4" m=""/><S T="0" X="430" Y="390" L="140" H="20" P="0,0,0.3,0.2,0,0,0,0" m=""/><S T="12" X="155" Y="363" L="40" H="30" P="0,0,0.5,0.2,0,0,0,0" o="61421b" c="3" m=""/><S T="12" X="142" Y="88" L="40" H="30" P="0,0,0.5,0.2,0,0,0,0" o="61421b" c="3" m=""/><S T="0" X="320" Y="110" L="150" H="20" P="0,0,0.3,0.2,-10,0,0,0" m=""/><S T="0" X="163" Y="104" L="180" H="20" P="0,0,9999,0.2,-20,0,0,0" m=""/><S T="19" X="268" Y="58" L="40" H="160" P="0,0,0.3,0,200,0,0,0" m=""/><S T="0" X="640" Y="370" L="30" H="240" P="0,0,0.3,0.2,0,0,0,0" m=""/><S T="12" X="331" Y="87" L="40" H="30" P="0,0,0.5,0.2,0,0,0,0" o="61421b" c="3" m=""/><S T="12" X="670" Y="185" L="180" H="100" P="0,0,0.3,0.2,0,0,0,0" o="51d451" c="4" m=""/><S T="0" X="-10" Y="320" L="20" H="120" P="0,0,0.3,0.2,0,0,0,0" m=""/><S T="1" X="-10" Y="130" L="20" H="260" P="0,0,0.2,0.2,0,0,0,0" m=""/></S><D><DS X="85" Y="367"/></D><O/><L><JPL c="baa07a,2,1,0" M1="3" M2="4" P3="260,245" P4="260,245"/><JR M1="5"/><JR M1="6"/><JR M1="6" M2="3"/><JR M1="5" M2="4"/><JPL c="baa07a,2,1,0" M1="11" M2="10" P3="405,177" P4="405,177"/><JR M1="8" M2="10"/><JR M1="9" M2="11"/><JR M1="7" M2="8"/><JR M1="7" M2="9"/><JR M1="21" M2="22"/><JR M1="21" M2="23"/><JR M1="41" M2="43"/><JR M1="42" M2="44"/><JR M1="40" M2="41"/><JR M1="40" M2="42"/><JR M1="22" M2="24"/><JR M1="23" M2="25"/><JPL c="baa07a,2,1,0" M1="30" M2="31" P3="82,145" P4="82,145"/><JR M1="27" M2="28"/><JR M1="27" M2="29"/><JR M1="28" M2="30"/><JR M1="29" M2="31"/><JPL c="baa07a,2,1,0" M1="19" M2="20" P3="530,20" P4="530,20"/><JR M1="16" M2="17"/><JR M1="16" M2="18"/><JR M1="17" M2="19"/><JR M1="18" M2="20"/></L></Z></C>')

sementes = {"17a34f87990.png", '17a34f89101.png', '17a34f8621e.png'}
flores = {'17a34f8a874.png', '17a34f8bfe6.png', '179c387d3eb.png', '179c3877a19.png', '179c3872ffb.png'}
corFlor = 0
vasos={{x = 140, y = 333, qtdSementes = 0, semente1 = 0, semente2 = 0, imagem = nil}, {x = 417, y = 331, qtdSementes = 0, semente1 = 0, semente2 = 0, imagem = nil},
{x = 701, y = 333, qtdSementes = 0, semente1 = 0, semente2 = 0, imagem = nil}, {x = 208, y = 178, qtdSsementes = 0, semente1 = 0, semente2 = 0, imagem = nil},
{x = 126, y = 60, qtdSementes = 0, semente1 = 0, semente2 = 0, imagem = nil}, {x = 316, y = 59, qtdSementes = 0, semente1 = 0, semente2 = 0, imagem = nil},
{x = 704, y = 54, qtdSementes = 0, semente1 = 0, semente2 = 0, imagem = nil}}
local p = {}

local Timer = {timeouts = {}, lastTimeoutId = 0, setTimeout = function(self, callback, timeout)
self.lastTimeoutId = self.lastTimeoutId + 1
self.timeouts[self.lastTimeoutId] = { disabled = false, c = callback, t = timeout}
return self.lastTimeoutId
end}

function atualizatimer()
for k, v in next, Timer.timeouts do
if not v.disabled then
v.t = v.t - 500
if v.t <= 0 then
v.c()
v.disabled = true
end
end
end
end

function crescer(vaso, cor1, cor2)
Timer:setTimeout(function()
tfm.exec.removeImage(vasos[vaso].imagem)
if (cor1 == 1 and cor2 == 2 or cor1 == 2 and cor2 == 1) then
vasos[vaso].imagem = tfm.exec.addImage(flores[4], "!1", vasos[vaso].x-7, vasos[vaso].y-30, nil)
elseif (cor1 == 2 and cor2 == 3 or cor1 == 3 and cor2 == 2) then
vasos[vaso].imagem = tfm.exec.addImage(flores[5], "!1", vasos[vaso].x-7, vasos[vaso].y-30, nil)
elseif (cor1 == 1 and cor2 == 3 or cor1 == 3 and cor2 == 1) then
vasos[vaso].imagem = tfm.exec.addImage(flores[3], "!1", vasos[vaso].x-7, vasos[vaso].y-30, nil)
elseif cor1 == cor2 then
vasos[vaso].imagem = tfm.exec.addImage(flores[2], "!1", vasos[vaso].x-7, vasos[vaso].y-30, nil)
end
end, 8000)
end

function plantar(player, vaso)
if p[player].mao > 0 then
if vasos[vaso].qtdSementes < 2 then
if vasos[vaso].qtdSementes == 0 then
tfm.exec.addImage(sementes[p[player].mao], "?1", vasos[vaso].x - 5, vasos[vaso].y+27, nil)
vasos[vaso].semente1 = p[player].mao vasos[vaso].qtdSementes = vasos[vaso].qtdSementes + 1
elseif vasos[vaso].qtdSementes == 1 then
vasos[vaso].imagem = tfm.exec.addImage(flores[1], "!1", vasos[vaso].x-7, vasos[vaso].y-30, nil)
tfm.exec.addImage(sementes[p[player].mao], "?1", vasos[vaso].x + 14, vasos[vaso].y+27, nil)
vasos[vaso].semente2 = p[player].mao vasos[vaso].qtdSementes = vasos[vaso].qtdSementes + 1
crescer(vaso, vasos[vaso].semente1, vasos[vaso].semente2)
end
tfm.exec.removeImage(p[player].imagem)
p[player].mao = 0
end
end
end

function eventLoop()
atualizatimer()
end

function eventNewPlayer(name)
if not p[name] then
p[name] = {
mao = 0,
imagem=0,
}
end
end

function eventKeyboard(name, key, down, x, y)
if (key == 40 or key == 83) then
if x > 5 and y > 281 and x < 89 and y < 378 then
if p[name].mao == 0 then
semente = math.random(1, 3)
p[name].mao = semente
p[name].imagem = tfm.exec.addImage(sementes[semente], "$"..name, 0, 0, nil)
end
elseif x > 140 and y == 333 and x < 173 then
plantar(name, 1)
elseif x > 415 and y == 331 and x < 451 then
plantar(name, 2)
elseif x > 692 and y == 333 and x < 733 then
plantar(name, 3)
elseif x > 201 and y == 177 and x < 241 then
plantar(name, 4)
elseif x > 121 and y == 58 and x < 160 then
plantar(name, 5)
elseif x > 309 and y == 57 and x < 354 then
plantar(name, 6)
elseif x > 698 and y == 52 and x < 738 then
plantar(name, 7)
end
end
end

function eventNewGame()
tfm.exec.addImage(flores[math.random(3, 5)], "?1", 596, 160, nil)
for name, player in pairs(tfm.get.room.playerList) do
for i,key in ipairs({40,83, 39, 37}) do
tfm.exec.bindKeyboard(name, key, true, true)
end
eventNewPlayer(name)
p[name].mao = math.random(1, 3)
p[name].imagem = tfm.exec.addImage(sementes[p[name].mao], "$"..name, 0, 0, nil)
end
end

function eventPlayerDied(name)
tfm.exec.respawnPlayer(name)
p[name].mao = 0
end

obs: escrevi errado na linha 2 (qtdSsemente ao invés de qtdSementes), fora isso o script funciona bem
Bolodefchoco
« Sénateur »
1624582560000
    • Bolodefchoco#0095
    • Profil
    • Derniers messages
    • Tribu
#3
  0
Edita a mensagem kkkk Senão não vão saber editar.
Sklag
« Citoyen »
1624759980000
    • Sklag#2552
    • Profil
    • Derniers messages
    • Tribu
#4
  0
Pipocalio ta ficando melhor em lua q eu ksk
Hallonin
« Consul »
1624803120000
    • Hallonin#0000
    • Profil
    • Derniers messages
    • Tribu
#5
  0
Sklag a dit :
Pipocalio ta ficando melhor em lua q eu ksk

Eu conheço os amigos que eu tenho rsrs
Belizard
« Censeur »
1625061060000
    • Belizard#6173
    • Profil
    • Derniers messages
#6
  0
Bom tópico!
  • Forums
  • /
  • Transformice
  • /
  • Modules
  • /
  • [Script] Evento da estufa
© Atelier801 2018

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

Version 1.27