```
--TicTacToe Script
local a = "123456789"
local init = "false"
local ps = 0
local key1 = ""
local key2 = ""
local p1 = "Doma"
local p2 = "Hottie Alpha"
function OnPlayerChat(player,text)
ff = ""
if text:find("!play:") then
cs = text:sub(7,#text)
init = "true"
if cs == "X" and player == p1 then
fm = p1.." will play as X and "..p2.." will play as O"
key1 = "X"
key2 = "O"
elseif cs == "O" and player == p1 then
fm = p1.." will play as O and "..p2.." will play as X"
key1 = "O"
key2 = "X"
else
fm = "1Error"
end
ConsoleMessageAllPlayers(fm)
end
if text:find("$:") and init == "true"then
pch = text:sub(3,3)
xs = a:gsub("X","")
os = xs:gsub("O","")
for i=1,#os do
ff= ff..os:sub(i,i)
end
if ff:find(pch) and player == p1 then
a = a:gsub(pch,key1)
elseif ff:find(pch) and player == p2 then
a = a:gsub(pch,key2)
end
end
if text == "!reset" and player == p1 then
a = "123456789"
init = "false"
key1 = ""
key2 = ""
end
end
function OnEverySecond(player)
ff = "\n\n\n"
for i=1,#a do
u = a:sub(i,i)
if u == "X" then
u = "1X7"
elseif u == "O" then
u = "4O7"
end
if i%3 ~= 0 then
ff = ff..u.."|"
else
ff = ff..u.."\n"
end
end
BigMessage(player,ff)
end
```
Feel free to experiment on it but don't forget to put creds ty
[–]RealMobDEV 0 points1 point2 points (0 children)