RobloxScripterAI
Discord ↗
Link Copied to Clipboard
×
"create tic tac toe script for 2 players"
-- local script local ticTacToe = script.Parent local player1 = game.Players.Player1 local player2 = game.Players.Player2 local turn = "player1" ticTacToe.Button1.MouseButton1Click:Connect(function() if turn == "player1" then ticTacToe.Button1.Text = "X" turn = "player2" end end) ticTacToe.Button2.MouseButton1Click:Connect(function() if turn == "player1" then ticTacToe.Button2.Text = "X" turn = "player2" end end) ticTacToe.Button3.MouseButton1Click:Connect(function() if turn == "player1" then ticTacToe.Button3.Text = "X" turn = "player2" end end) ticTacToe.Button4.MouseButton1Click:Connect(function() if turn == "player2" then ticTacToe.Button4.Text = "O" turn = "player1" end end) ticTacToe.Button5.MouseButton1Click:Connect(function() if turn == "player2" then ticTacToe.Button5.Text = "O" turn = "player1" end end) ticTacToe.Button6.MouseButton1Click:Connect(function() if turn == "player2" then ticTacToe.Button6.Text = "O" turn = "player1" end end)