I tried on TFS 0.3.6, Everything working but it never ends, they dont get tped out :S
Code:[Error - Action Interface] In a timer event called from: data/actions/scripts/tic.lua:onUse Description: (luaDoRemoveCreature) Creature not found
Help Please
I tried on TFS 0.3.6, Everything working but it never ends, they dont get tped out :S
Code:[Error - Action Interface] In a timer event called from: data/actions/scripts/tic.lua:onUse Description: (luaDoRemoveCreature) Creature not found
@sweedy i didnt atcually tried on 0.3.6 ,
does the chicken appear ?
thechicken appear so does players wins rounds ornot?
I'm using TFS 0.3.6pl1 Crying Damson, and it does works.
sweddy, maybe you didn't edit/paste correctly, try checking/pasting again.
local gameT = {
{0,0,0},
{0,0,0},
{0,0,0},
}
function checkTicTacToe(gameT)
local P1 = 1 -- Player 1
local P2 = 2 -- Player 2
local winner = 0
local count = {
[P1] = {V={0,0,0},H={0,0,0},D={0,0}},
[P2] = {V={0,0,0},H={0,0,0},D={0,0}},
}
for i = 1, 3 do
for k = 1,3 do
if gameT[i][k] > 0 then -- horizontal
count[gameT[i][k]].H[i] = count[gameT[i][k]].H[i] + 1
if count[gameT[i][k]].H[i] == 3 then
winner = gameT[i][k]
end
end
if gameT[k][i] > 0 then -- vertical
count[gameT[k][i]].V[i] = count[gameT[k][i]].V[i] + 1
if count[gameT[k][i]].V[i] == 3 then
winner = gameT[k][i]
end
end
if i == 1 and gameT[k][k] > 0 then -- diagonal 1
count[gameT[k][k]].D[1] = count[gameT[k][k]].D[1] + 1
if count[gameT[k][k]].D[1] == 3 then
winner = gameT[k][k]
end
end
if i == 3 and gameT[k][(i-k)+1] > 0 then -- diagonal 2
count[gameT[k][(i-k)+1]].D[2] = count[gameT[k][(i-k)+1]].D[2] + 1
if count[gameT[k][(i-k)+1]].D[2] == 3 then
winner = gameT[k][(i-k)+1]
end
end
end
end
print(winner == 0 and "Draw." or "Player:" .. winner .." won the game.")
end
checkTicTacToe(gameT)
Phases_Tic_Tac = {
-- // Horizontal raws \\--
{ {x = tic_pos.frompos.x, y = tic_pos.frompos.y, z = tic_pos.frompos.z } , {x = tic_pos.frompos.x+1, y = tic_pos.frompos.y, z = tic_pos.frompos.z } , {x = tic_pos.frompos.x+2, y = tic_pos.frompos.y, z = tic_pos.frompos.z } },
{ {x = tic_pos.frompos.x, y = tic_pos.frompos.y+1, z = tic_pos.frompos.z } , {x = tic_pos.frompos.x+1, y = tic_pos.frompos.y+1, z = tic_pos.frompos.z } , {x = tic_pos.frompos.x+2, y = tic_pos.frompos.y+1, z = tic_pos.frompos.z } },
{ {x = tic_pos.frompos.x, y = tic_pos.frompos.y+2, z = tic_pos.frompos.z } , {x = tic_pos.frompos.x+1, y = tic_pos.frompos.y+2, z = tic_pos.frompos.z } , {x = tic_pos.frompos.x+2, y = tic_pos.frompos.y+2, z = tic_pos.frompos.z } },
-- // Vertical raws \\--
{ {x = tic_pos.frompos.x, y = tic_pos.frompos.y, z = tic_pos.frompos.z } , {x = tic_pos.frompos.x, y = tic_pos.frompos.y+1, z = tic_pos.frompos.z } , {x = tic_pos.frompos.x, y = tic_pos.frompos.y+2, z = tic_pos.frompos.z } },
{ {x = tic_pos.frompos.x+1, y = tic_pos.frompos.y, z = tic_pos.frompos.z } , {x = tic_pos.frompos.x+1, y = tic_pos.frompos.y+1, z = tic_pos.frompos.z } , {x = tic_pos.frompos.x+1, y = tic_pos.frompos.y+2, z = tic_pos.frompos.z } },
{ {x = tic_pos.frompos.x+2, y = tic_pos.frompos.y, z = tic_pos.frompos.z } , {x = tic_pos.frompos.x+2, y = tic_pos.frompos.y+1, z = tic_pos.frompos.z } , {x = tic_pos.frompos.x+2, y = tic_pos.frompos.y+2, z = tic_pos.frompos.z } },
--// Crosses raws \\--
{ {x = tic_pos.frompos.x, y = tic_pos.frompos.y, z = tic_pos.frompos.z } , {x = tic_pos.frompos.x+1, y = tic_pos.frompos.y+1, z = tic_pos.frompos.z } , {x = tic_pos.frompos.x+2, y = tic_pos.frompos.y+2, z = tic_pos.frompos.z } },
{ {x = tic_pos.frompos.x, y = tic_pos.frompos.y+2, z = tic_pos.frompos.z } , {x = tic_pos.frompos.x+1, y = tic_pos.frompos.y+1, z = tic_pos.frompos.z } , {x = tic_pos.frompos.x+2, y = tic_pos.frompos.y, z = tic_pos.frompos.z } }
This is just a pure system of no need as i can do things the easy way no need to do it th hard way ,by hard way i dont mean this is a hard scripting , it is just a way of math and thinking.
can you upload the map in 8.54? :$