Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- Settings:
- local Player_ = owner
- -- Guis
- -- TicTacToe Gui
- local TicTacToe = Instance.new("ScreenGui")
- local Background = Instance.new("Frame")
- local Bar = Instance.new("Frame")
- local Bar_2 = Instance.new("Frame")
- local Bar_3 = Instance.new("Frame")
- local Bar_4 = Instance.new("Frame")
- local Grid1 = Instance.new("TextButton")
- local Grid4 = Instance.new("TextButton")
- local Grid2 = Instance.new("TextButton")
- local Grid7 = Instance.new("TextButton")
- local Grid5 = Instance.new("TextButton")
- local Grid3 = Instance.new("TextButton")
- local Grid8 = Instance.new("TextButton")
- local Grid6 = Instance.new("TextButton")
- local Grid9 = Instance.new("TextButton")
- local XPlayer = Instance.new("TextLabel")
- local OPlayer = Instance.new("TextLabel")
- -- Properties
- TicTacToe.Name = "TicTacToe"
- TicTacToe.ZIndexBehavior = Enum.ZIndexBehavior.Sibling
- TicTacToe.ResetOnSpawn = false
- Background.Name = "Background"
- Background.Parent = TicTacToe
- Background.AnchorPoint = Vector2.new(0.5, 0.5)
- Background.BackgroundColor3 = Color3.new(0.780392, 0.780392, 0.780392)
- Background.BackgroundTransparency = 0.5
- Background.BorderSizePixel = 0
- Background.Position = UDim2.new(0.5, 0, 0.5, 0)
- Background.Size = UDim2.new(0.349999994, 0, 0.349999994, 0)
- Background.SizeConstraint = Enum.SizeConstraint.RelativeXX
- Bar.Name = "Bar"
- Bar.Parent = Background
- Bar.AnchorPoint = Vector2.new(0.5, 0)
- Bar.BackgroundColor3 = Color3.new(0, 0, 0)
- Bar.BorderSizePixel = 0
- Bar.Position = UDim2.new(0.333333343, 0, 0, 0)
- Bar.Size = UDim2.new(0.0250000004, 0, 1, 0)
- Bar_2.Name = "Bar"
- Bar_2.Parent = Background
- Bar_2.AnchorPoint = Vector2.new(0.5, 0)
- Bar_2.BackgroundColor3 = Color3.new(0, 0, 0)
- Bar_2.BorderSizePixel = 0
- Bar_2.Position = UDim2.new(0.666666687, 0, 0, 0)
- Bar_2.Size = UDim2.new(0.0250000004, 0, 1, 0)
- Bar_3.Name = "Bar"
- Bar_3.Parent = Background
- Bar_3.AnchorPoint = Vector2.new(0, 0.5)
- Bar_3.BackgroundColor3 = Color3.new(0, 0, 0)
- Bar_3.BorderSizePixel = 0
- Bar_3.Position = UDim2.new(0, 0, 0.333333343, 0)
- Bar_3.Size = UDim2.new(1, 0, 0.0250000004, 0)
- Bar_4.Name = "Bar"
- Bar_4.Parent = Background
- Bar_4.AnchorPoint = Vector2.new(0, 0.5)
- Bar_4.BackgroundColor3 = Color3.new(0, 0, 0)
- Bar_4.BorderSizePixel = 0
- Bar_4.Position = UDim2.new(0, 0, 0.666666687, 0)
- Bar_4.Size = UDim2.new(1, 0, 0.0250000004, 0)
- Grid1.Name = "Grid1"
- Grid1.Parent = Background
- Grid1.BackgroundColor3 = Color3.new(1, 1, 1)
- Grid1.BackgroundTransparency = 1
- Grid1.Size = UDim2.new(0.333333343, 0, 0.333333343, 0)
- Grid1.Font = Enum.Font.SourceSans
- Grid1.Text = ""
- Grid1.TextColor3 = Color3.new(0, 0, 0)
- Grid1.TextScaled = true
- Grid1.TextSize = 14
- Grid1.TextWrapped = true
- Grid4.Name = "Grid4"
- Grid4.Parent = Background
- Grid4.BackgroundColor3 = Color3.new(1, 1, 1)
- Grid4.BackgroundTransparency = 1
- Grid4.Position = UDim2.new(0, 0, 0.333000004, 0)
- Grid4.Size = UDim2.new(0.333333343, 0, 0.333333343, 0)
- Grid4.Font = Enum.Font.SourceSans
- Grid4.Text = ""
- Grid4.TextColor3 = Color3.new(0, 0, 0)
- Grid4.TextScaled = true
- Grid4.TextSize = 14
- Grid4.TextWrapped = true
- Grid2.Name = "Grid2"
- Grid2.Parent = Background
- Grid2.BackgroundColor3 = Color3.new(1, 1, 1)
- Grid2.BackgroundTransparency = 1
- Grid2.Position = UDim2.new(0.333333343, 0, 0, 0)
- Grid2.Size = UDim2.new(0.333333343, 0, 0.333333343, 0)
- Grid2.Font = Enum.Font.SourceSans
- Grid2.Text = ""
- Grid2.TextColor3 = Color3.new(0, 0, 0)
- Grid2.TextScaled = true
- Grid2.TextSize = 14
- Grid2.TextWrapped = true
- Grid7.Name = "Grid7"
- Grid7.Parent = Background
- Grid7.BackgroundColor3 = Color3.new(1, 1, 1)
- Grid7.BackgroundTransparency = 1
- Grid7.Position = UDim2.new(0, 0, 0.666000009, 0)
- Grid7.Size = UDim2.new(0.333333343, 0, 0.333333343, 0)
- Grid7.Font = Enum.Font.SourceSans
- Grid7.Text = ""
- Grid7.TextColor3 = Color3.new(0, 0, 0)
- Grid7.TextScaled = true
- Grid7.TextSize = 14
- Grid7.TextWrapped = true
- Grid5.Name = "Grid5"
- Grid5.Parent = Background
- Grid5.BackgroundColor3 = Color3.new(1, 1, 1)
- Grid5.BackgroundTransparency = 1
- Grid5.Position = UDim2.new(0.333333343, 0, 0.333000004, 0)
- Grid5.Size = UDim2.new(0.333333343, 0, 0.333333343, 0)
- Grid5.Font = Enum.Font.SourceSans
- Grid5.Text = ""
- Grid5.TextColor3 = Color3.new(0, 0, 0)
- Grid5.TextScaled = true
- Grid5.TextSize = 14
- Grid5.TextWrapped = true
- Grid3.Name = "Grid3"
- Grid3.Parent = Background
- Grid3.BackgroundColor3 = Color3.new(1, 1, 1)
- Grid3.BackgroundTransparency = 1
- Grid3.Position = UDim2.new(0.666665971, 0, 0, 0)
- Grid3.Size = UDim2.new(0.333333343, 0, 0.333333343, 0)
- Grid3.Font = Enum.Font.SourceSans
- Grid3.Text = ""
- Grid3.TextColor3 = Color3.new(0, 0, 0)
- Grid3.TextScaled = true
- Grid3.TextSize = 14
- Grid3.TextWrapped = true
- Grid8.Name = "Grid8"
- Grid8.Parent = Background
- Grid8.BackgroundColor3 = Color3.new(1, 1, 1)
- Grid8.BackgroundTransparency = 1
- Grid8.Position = UDim2.new(0.333333343, 0, 0.666000009, 0)
- Grid8.Size = UDim2.new(0.333333343, 0, 0.333333343, 0)
- Grid8.Font = Enum.Font.SourceSans
- Grid8.Text = ""
- Grid8.TextColor3 = Color3.new(0, 0, 0)
- Grid8.TextScaled = true
- Grid8.TextSize = 14
- Grid8.TextWrapped = true
- Grid6.Name = "Grid6"
- Grid6.Parent = Background
- Grid6.BackgroundColor3 = Color3.new(1, 1, 1)
- Grid6.BackgroundTransparency = 1
- Grid6.Position = UDim2.new(0.666665971, 0, 0.333000004, 0)
- Grid6.Size = UDim2.new(0.333333343, 0, 0.333333343, 0)
- Grid6.Font = Enum.Font.SourceSans
- Grid6.Text = ""
- Grid6.TextColor3 = Color3.new(0, 0, 0)
- Grid6.TextScaled = true
- Grid6.TextSize = 14
- Grid6.TextWrapped = true
- Grid9.Name = "Grid9"
- Grid9.Parent = Background
- Grid9.BackgroundColor3 = Color3.new(1, 1, 1)
- Grid9.BackgroundTransparency = 1
- Grid9.Position = UDim2.new(0.666665971, 0, 0.666000009, 0)
- Grid9.Size = UDim2.new(0.333333343, 0, 0.333333343, 0)
- Grid9.Font = Enum.Font.SourceSans
- Grid9.Text = ""
- Grid9.TextColor3 = Color3.new(0, 0, 0)
- Grid9.TextScaled = true
- Grid9.TextSize = 14
- Grid9.TextWrapped = true
- XPlayer.Name = "XPlayer"
- XPlayer.Parent = Background
- XPlayer.AnchorPoint = Vector2.new(0, 1)
- XPlayer.BackgroundColor3 = Color3.new(1, 1, 1)
- XPlayer.BackgroundTransparency = 1
- XPlayer.Size = UDim2.new(0.449999988, 0, 0.0500000007, 0)
- XPlayer.Font = Enum.Font.SourceSans
- XPlayer.Text = "(X): Memo1332"
- XPlayer.TextColor3 = Color3.new(0, 0, 0)
- XPlayer.TextScaled = true
- XPlayer.TextSize = 14
- XPlayer.TextWrapped = true
- XPlayer.TextXAlignment = Enum.TextXAlignment.Left
- XPlayer.TextYAlignment = Enum.TextYAlignment.Bottom
- OPlayer.Name = "OPlayer"
- OPlayer.Parent = Background
- OPlayer.AnchorPoint = Vector2.new(1, 1)
- OPlayer.BackgroundColor3 = Color3.new(1, 1, 1)
- OPlayer.BackgroundTransparency = 1
- OPlayer.Position = UDim2.new(1, 0, 0, 0)
- OPlayer.Size = UDim2.new(0.449999988, 0, 0.0500000007, 0)
- OPlayer.Font = Enum.Font.SourceSans
- OPlayer.Text = "sadpandu :(O)"
- OPlayer.TextColor3 = Color3.new(0, 0, 0)
- OPlayer.TextScaled = true
- OPlayer.TextSize = 14
- OPlayer.TextWrapped = true
- OPlayer.TextXAlignment = Enum.TextXAlignment.Right
- OPlayer.TextYAlignment = Enum.TextYAlignment.Bottom
- -- Request GUI
- local Request = Instance.new("ScreenGui")
- local Outer = Instance.new("Frame")
- local Inner = Instance.new("Frame")
- local TextLabel = Instance.new("TextLabel")
- local Exit = Instance.new("TextButton")
- local Back = Instance.new("Frame")
- local TextLabel_2 = Instance.new("TextLabel")
- local Yes = Instance.new("TextButton")
- local No = Instance.new("TextButton")
- -- Properties
- Request.Name = "Request"
- Request.Parent = game.ServerStorage
- Request.ZIndexBehavior = Enum.ZIndexBehavior.Sibling
- Request.ResetOnSpawn = false
- Outer.Name = "Outer"
- Outer.Parent = Request
- Outer.AnchorPoint = Vector2.new(0.5, 0.5)
- Outer.BackgroundColor3 = Color3.new(1, 1, 1)
- Outer.BackgroundTransparency = 0.5
- Outer.BorderSizePixel = 0
- Outer.Position = UDim2.new(0.5, 0, 1, 0)
- Outer.Size = UDim2.new(0.5, 0, 0.400000006, 0)
- Inner.Name = "Inner"
- Inner.Parent = Outer
- Inner.BackgroundColor3 = Color3.new(0, 0, 0)
- Inner.BackgroundTransparency = 0.5
- Inner.BorderColor3 = Color3.new(0.105882, 0.164706, 0.207843)
- Inner.BorderSizePixel = 0
- Inner.Size = UDim2.new(1, 0, 0.150000006, 0)
- TextLabel.Parent = Inner
- TextLabel.BackgroundColor3 = Color3.new(1, 1, 1)
- TextLabel.BackgroundTransparency = 1
- TextLabel.BorderSizePixel = 0
- TextLabel.Size = UDim2.new(1, 0, 1, 0)
- TextLabel.Font = Enum.Font.SourceSans
- TextLabel.Text = "Invitation"
- TextLabel.TextColor3 = Color3.new(1, 1, 1)
- TextLabel.TextScaled = true
- TextLabel.TextSize = 14
- TextLabel.TextWrapped = true
- TextLabel.TextXAlignment = Enum.TextXAlignment.Left
- Exit.Name = "Exit"
- Exit.Parent = Inner
- Exit.AnchorPoint = Vector2.new(1, 0)
- Exit.BackgroundColor3 = Color3.new(1, 1, 1)
- Exit.BackgroundTransparency = 1
- Exit.BorderSizePixel = 0
- Exit.Position = UDim2.new(1, 0, 0, 0)
- Exit.Size = UDim2.new(1, 0, 1, 0)
- Exit.SizeConstraint = Enum.SizeConstraint.RelativeYY
- Exit.Font = Enum.Font.SourceSans
- Exit.Text = "X"
- Exit.TextColor3 = Color3.new(1, 1, 1)
- Exit.TextScaled = true
- Exit.TextSize = 14
- Exit.TextWrapped = true
- Back.Name = "Back"
- Back.Parent = Outer
- Back.BackgroundColor3 = Color3.new(1, 1, 1)
- Back.BackgroundTransparency = 1
- Back.Position = UDim2.new(0, 0, 0.150000006, 0)
- Back.Size = UDim2.new(1, 0, 0.850000024, 0)
- TextLabel_2.Parent = Back
- TextLabel_2.BackgroundColor3 = Color3.new(1, 1, 1)
- TextLabel_2.BackgroundTransparency = 1
- TextLabel_2.Size = UDim2.new(1, 0, 0.699999988, 0)
- TextLabel_2.Font = Enum.Font.SourceSans
- TextLabel_2.Text = ""
- TextLabel_2.TextColor3 = Color3.new(0, 0, 0)
- TextLabel_2.TextScaled = true
- TextLabel_2.TextSize = 55
- TextLabel_2.TextWrapped = true
- Yes.Name = "Yes"
- Yes.Parent = Back
- Yes.AnchorPoint = Vector2.new(1, 0)
- Yes.BackgroundColor3 = Color3.new(0, 0.74902, 0.0235294)
- Yes.BorderColor3 = Color3.new(0.254902, 0.835294, 0.211765)
- Yes.BorderSizePixel = 5
- Yes.Position = UDim2.new(0.449999988, 0, 0.800000012, 0)
- Yes.Size = UDim2.new(0.300000012, 0, 0.150000006, 0)
- Yes.Font = Enum.Font.SourceSans
- Yes.Text = "Yes"
- Yes.TextColor3 = Color3.new(1, 1, 1)
- Yes.TextScaled = true
- Yes.TextSize = 14
- Yes.TextWrapped = true
- No.Name = "No"
- No.Parent = Back
- No.BackgroundColor3 = Color3.new(0.74902, 0, 0.0117647)
- No.BorderColor3 = Color3.new(0.835294, 0, 0.0117647)
- No.BorderSizePixel = 5
- No.Position = UDim2.new(0.550000012, 0, 0.800000012, 0)
- No.Size = UDim2.new(0.300000012, 0, 0.150000006, 0)
- No.Font = Enum.Font.SourceSans
- No.Text = "No"
- No.TextColor3 = Color3.new(1, 1, 1)
- No.TextScaled = true
- No.TextSize = 14
- No.TextWrapped = true
- -- Deny GUI
- local Deny = Instance.new("ScreenGui")
- local Tec = Instance.new("TextLabel")
- -- Properties
- Deny.Name = "Deny"
- Deny.ZIndexBehavior = Enum.ZIndexBehavior.Sibling
- Tec.Name = "Tec"
- Tec.Parent = Deny
- Tec.AnchorPoint = Vector2.new(1, 1)
- Tec.BackgroundColor3 = Color3.new(0, 0, 0)
- Tec.BackgroundTransparency = 0.5
- Tec.Position = UDim2.new(1, -10, 1.1, -10)
- Tec.Size = UDim2.new(0.150000006, 0, 0.050999999, 0)
- Tec.Font = Enum.Font.SourceSans
- Tec.Text = "Player denied your request"
- Tec.TextColor3 = Color3.new(1, 1, 1)
- Tec.TextScaled = true
- Tec.TextSize = 14
- Tec.TextWrapped = true
- -- Actual Script
- function findplayer(playername)
- for i,v in pairs(game.Players:GetChildren()) do
- local nam = v.Name
- if string.sub(nam,1,#playername):lower() == playername:lower() then
- return v
- end
- end
- return nil
- end
- Player_.Chatted:Connect(function(message)
- coroutine.resume(coroutine.create(function()
- if string.sub(message,1,4):lower() == "1v1/" then
- local plr = findplayer(string.sub(message,5))
- if plr ~= nil then
- local response = nil
- local clon = Request:Clone()
- clon.Parent = plr.PlayerGui
- clon.Outer:TweenPosition(UDim2.new(0.5,0,0.5,0),Enum.EasingDirection.Out,Enum.EasingStyle.Back,0.5,true)
- clon.Outer.Back.TextLabel.Text = Player_.Name.." has invited you to play tic tac toe! Would you like to accept their invitation?"
- --
- clon.Outer.Back.No.MouseButton1Click:Connect(function()
- response = false
- end)
- clon.Outer.Inner.Exit.MouseButton1Click:Connect(function()
- response = false
- end)
- clon.Outer.Back.Yes.MouseButton1Click:Connect(function()
- response = true
- end)
- repeat wait() until response ~= nil
- clon:Destroy()
- if response == true then
- local antispam = false
- local clone1 = TicTacToe:Clone()
- local clone2 = TicTacToe:Clone()
- clone1.Parent = Player_.PlayerGui
- clone2.Parent = plr.PlayerGui
- clone1.Background.OPlayer.Text = plr.Name.." :(O)"
- clone2.Background.OPlayer.Text = plr.Name.." :(O)"
- clone1.Background.XPlayer.Text = "(X): "..Player_.Name
- clone2.Background.XPlayer.Text = "(X): "..Player_.Name
- for i,v in pairs(clone2.Background:GetChildren()) do
- if string.sub(v.Name,1,3) == "Bar" then
- v.BackgroundTransparency = 0.5
- end
- end
- local xturn = true
- local function istherewin()
- local k = clone1.Background
- local winner = "nobody"
- local code = nil
- local tex = ""
- if k.Grid1.Text == "X" then tex = tex.."x" elseif k.Grid1.Text == "O" then tex = tex.."o" else tex = tex.."." end
- if k.Grid2.Text == "X" then tex = tex.."x" elseif k.Grid2.Text == "O" then tex = tex.."o" else tex = tex.."." end
- if k.Grid3.Text == "X" then tex = tex.."x" elseif k.Grid3.Text == "O" then tex = tex.."o" else tex = tex.."." end
- if k.Grid4.Text == "X" then tex = tex.."x" elseif k.Grid4.Text == "O" then tex = tex.."o" else tex = tex.."." end
- if k.Grid5.Text == "X" then tex = tex.."x" elseif k.Grid5.Text == "O" then tex = tex.."o" else tex = tex.."." end
- if k.Grid6.Text == "X" then tex = tex.."x" elseif k.Grid6.Text == "O" then tex = tex.."o" else tex = tex.."." end
- if k.Grid7.Text == "X" then tex = tex.."x" elseif k.Grid7.Text == "O" then tex = tex.."o" else tex = tex.."." end
- if k.Grid8.Text == "X" then tex = tex.."x" elseif k.Grid8.Text == "O" then tex = tex.."o" else tex = tex.."." end
- if k.Grid9.Text == "X" then tex = tex.."x" elseif k.Grid9.Text == "O" then tex = tex.."o" else tex = tex.."." end
- print(tex)
- --to make things neater:
- local function sub(num)
- return string.sub(tex,num,num)
- end
- if sub(1) == "x" and sub(5) == "x" and sub(9) == "x" then
- winner = "x"
- code = 159
- elseif sub(1) == "o" and sub(5) == "o" and sub(9) == "o" then
- winner = "o"
- code = 159
- elseif sub(3) == "x" and sub(5) == "x" and sub(7) == "x" then
- winner = "x"
- code = 357
- elseif sub(3) == "o" and sub(5) == "o" and sub(7) == "o" then
- winner = "o"
- code = 357
- elseif sub(1) == "x" and sub(2) == "x" and sub(3) == "x" then
- winner = "x"
- code = 123
- elseif sub(1) == "o" and sub(2) == "o" and sub(3) == "o" then
- winner = "o"
- code = 123
- elseif sub(4) == "x" and sub(5) == "x" and sub(6) == "x" then
- winner = "x"
- code = 456
- elseif sub(4) == "o" and sub(5) == "o" and sub(6) == "o" then
- winner = "o"
- code = 456
- elseif sub(7) == "x" and sub(8) == "x" and sub(9) == "x" then
- winner = "x"
- code = 789
- elseif sub(7) == "o" and sub(8) == "o" and sub(9) == "o" then
- winner = "o"
- code = 789
- elseif sub(1) == "x" and sub(4) == "x" and sub(7) == "x" then
- winner = "x"
- code = 147
- elseif sub(1) == "o" and sub(4) == "o" and sub(7) == "o" then
- winner = "o"
- code = 147
- elseif sub(2) == "x" and sub(5) == "x" and sub(8) == "x" then
- winner = "x"
- code = 258
- elseif sub(2) == "o" and sub(5) == "o" and sub(8) == "o" then
- winner = "o"
- code = 258
- elseif sub(3) == "x" and sub(6) == "x" and sub(9) == "x" then
- winner = "x"
- code = 369
- elseif sub(3) == "o" and sub(6) == "o" and sub(9) == "o" then
- winner = "o"
- code = 369
- elseif sub(1) ~= "." and sub(2) ~= "." and sub(3) ~= "." and sub(4) ~= "." and sub(5) ~= "." and sub(6) ~= "." and sub(7) ~= "." and sub(8) ~= "." and sub(9) ~= "." then
- winner = "cat"
- end
- local function animateWinner()
- code = tostring(code)
- local grids = {}
- for i=1,#code do
- local num = (string.sub(code,i,i))
- table.insert(grids,clone1.Background:FindFirstChild("Grid"..num))
- table.insert(grids,clone2.Background:FindFirstChild("Grid"..num))
- end
- --
- for i=1,4 do
- for ii=1,#grids do
- grids[ii].TextColor3 = Color3.fromRGB(255, 200, 0)
- end
- wait(.3)
- for ii=1,#grids do
- grids[ii].TextColor3 = Color3.fromRGB(0, 0, 0)
- end
- wait(.3)
- end
- end
- if winner == "x" or winner == "o" then
- xturn = nil
- animateWinner()
- wait(2)
- clone1:Destroy()
- clone2:Destroy()
- elseif winner == "cat" then
- wait(2)
- for i,v in pairs(clone1.Background:GetChildren()) do
- if string.sub(v.Name,1,4) == "Grid" then
- v.Text = ""
- end
- end
- for i,v in pairs(clone2.Background:GetChildren()) do
- if string.sub(v.Name,1,4) == "Grid" then
- v.Text = ""
- end
- end
- end
- if xturn == true then
- for i,v in pairs(clone1.Background:GetChildren()) do
- if string.sub(v.Name,1,3) == "Bar" then
- v.BackgroundTransparency = 0
- end
- end
- for i,v in pairs(clone2.Background:GetChildren()) do
- if string.sub(v.Name,1,3) == "Bar" then
- v.BackgroundTransparency = 0.5
- end
- end
- elseif xturn == false then
- for i,v in pairs(clone1.Background:GetChildren()) do
- if string.sub(v.Name,1,3) == "Bar" then
- v.BackgroundTransparency = 0.5
- end
- end
- for i,v in pairs(clone2.Background:GetChildren()) do
- if string.sub(v.Name,1,3) == "Bar" then
- v.BackgroundTransparency = 0
- end
- end
- end
- end
- clone1.Background.Grid1.MouseButton1Click:Connect(function()
- if xturn == true and antispam == false and clone1.Background.Grid1.Text == "" then
- antispam = true
- xturn = false
- clone1.Background.Grid1.Text = "X"
- clone2.Background.Grid1.Text = "X"
- wait(.5)
- istherewin()
- wait(.25)
- antispam = false
- end
- end)
- clone1.Background.Grid2.MouseButton1Click:Connect(function()
- if xturn == true and antispam == false and clone1.Background.Grid2.Text == "" then
- antispam = true
- xturn = false
- clone1.Background.Grid2.Text = "X"
- clone2.Background.Grid2.Text = "X"
- wait(.5)
- istherewin()
- wait(.25)
- antispam = false
- end
- end)
- clone1.Background.Grid3.MouseButton1Click:Connect(function()
- if xturn == true and antispam == false and clone1.Background.Grid3.Text == "" then
- antispam = true
- xturn = false
- clone1.Background.Grid3.Text = "X"
- clone2.Background.Grid3.Text = "X"
- wait(.5)
- istherewin()
- wait(.25)
- antispam = false
- end
- end)
- clone1.Background.Grid4.MouseButton1Click:Connect(function()
- if xturn == true and antispam == false and clone1.Background.Grid4.Text == "" then
- antispam = true
- xturn = false
- clone1.Background.Grid4.Text = "X"
- clone2.Background.Grid4.Text = "X"
- wait(.5)
- istherewin()
- wait(.25)
- antispam = false
- end
- end)
- clone1.Background.Grid5.MouseButton1Click:Connect(function()
- if xturn == true and antispam == false and clone1.Background.Grid5.Text == "" then
- antispam = true
- xturn = false
- clone1.Background.Grid5.Text = "X"
- clone2.Background.Grid5.Text = "X"
- wait(.5)
- istherewin()
- wait(.25)
- antispam = false
- end
- end)
- clone1.Background.Grid6.MouseButton1Click:Connect(function()
- if xturn == true and antispam == false and clone1.Background.Grid6.Text == "" then
- antispam = true
- xturn = false
- clone1.Background.Grid6.Text = "X"
- clone2.Background.Grid6.Text = "X"
- wait(.5)
- istherewin()
- wait(.25)
- antispam = false
- end
- end)
- clone1.Background.Grid7.MouseButton1Click:Connect(function()
- if xturn == true and antispam == false and clone1.Background.Grid7.Text == "" then
- antispam = true
- xturn = false
- clone1.Background.Grid7.Text = "X"
- clone2.Background.Grid7.Text = "X"
- wait(.5)
- istherewin()
- wait(.25)
- antispam = false
- end
- end)
- clone1.Background.Grid8.MouseButton1Click:Connect(function()
- if xturn == true and antispam == false and clone1.Background.Grid8.Text == "" then
- antispam = true
- xturn = false
- clone1.Background.Grid8.Text = "X"
- clone2.Background.Grid8.Text = "X"
- wait(.5)
- istherewin()
- wait(.25)
- antispam = false
- end
- end)
- clone1.Background.Grid9.MouseButton1Click:Connect(function()
- if xturn == true and antispam == false and clone1.Background.Grid9.Text == "" then
- antispam = true
- xturn = false
- clone1.Background.Grid9.Text = "X"
- clone2.Background.Grid9.Text = "X"
- wait(.5)
- istherewin()
- wait(.25)
- antispam = false
- end
- end)
- ------------------------------------------------------------------------------------------------------------
- clone2.Background.Grid1.MouseButton1Click:Connect(function()
- if xturn == false and antispam == false and clone2.Background.Grid1.Text == "" then
- antispam = true
- xturn = true
- clone1.Background.Grid1.Text = "O"
- clone2.Background.Grid1.Text = "O"
- wait(.5)
- istherewin()
- wait(.25)
- antispam = false
- end
- end)
- clone2.Background.Grid2.MouseButton1Click:Connect(function()
- if xturn == false and antispam == false and clone2.Background.Grid2.Text == "" then
- antispam = true
- xturn = true
- clone1.Background.Grid2.Text = "O"
- clone2.Background.Grid2.Text = "O"
- wait(.5)
- istherewin()
- wait(.25)
- antispam = false
- end
- end)
- clone2.Background.Grid3.MouseButton1Click:Connect(function()
- if xturn == false and antispam == false and clone2.Background.Grid3.Text == "" then
- antispam = true
- xturn = true
- clone1.Background.Grid3.Text = "O"
- clone2.Background.Grid3.Text = "O"
- wait(.5)
- istherewin()
- wait(.25)
- antispam = false
- end
- end)
- clone2.Background.Grid4.MouseButton1Click:Connect(function()
- if xturn == false and antispam == false and clone2.Background.Grid4.Text == "" then
- antispam = true
- xturn = true
- clone1.Background.Grid4.Text = "O"
- clone2.Background.Grid4.Text = "O"
- wait(.5)
- istherewin()
- wait(.25)
- antispam = false
- end
- end)
- clone2.Background.Grid5.MouseButton1Click:Connect(function()
- if xturn == false and antispam == false and clone2.Background.Grid5.Text == "" then
- antispam = true
- xturn = true
- clone1.Background.Grid5.Text = "O"
- clone2.Background.Grid5.Text = "O"
- wait(.5)
- istherewin()
- wait(.25)
- antispam = false
- end
- end)
- clone2.Background.Grid6.MouseButton1Click:Connect(function()
- if xturn == false and antispam == false and clone2.Background.Grid6.Text == "" then
- antispam = true
- xturn = true
- clone1.Background.Grid6.Text = "O"
- clone2.Background.Grid6.Text = "O"
- wait(.5)
- istherewin()
- wait(.25)
- antispam = false
- end
- end)
- clone2.Background.Grid7.MouseButton1Click:Connect(function()
- if xturn == false and antispam == false and clone2.Background.Grid7.Text == "" then
- antispam = true
- xturn = true
- clone1.Background.Grid7.Text = "O"
- clone2.Background.Grid7.Text = "O"
- wait(.5)
- istherewin()
- wait(.25)
- antispam = false
- end
- end)
- clone2.Background.Grid8.MouseButton1Click:Connect(function()
- if xturn == false and antispam == false and clone2.Background.Grid8.Text == "" then
- antispam = true
- xturn = true
- clone1.Background.Grid8.Text = "O"
- clone2.Background.Grid8.Text = "O"
- wait(.5)
- istherewin()
- wait(.25)
- antispam = false
- end
- end)
- clone2.Background.Grid9.MouseButton1Click:Connect(function()
- if xturn == false and antispam == false and clone2.Background.Grid9.Text == "" then
- antispam = true
- xturn = true
- clone1.Background.Grid9.Text = "O"
- clone2.Background.Grid9.Text = "O"
- wait(.5)
- istherewin()
- wait(.25)
- antispam = false
- end
- end)
- else
- local clon = Deny:Clone()
- clon.Parent = Player_.PlayerGui
- clon.Tec.Text = plr.Name.." denied your request"
- coroutine.resume(coroutine.create(function()
- clon.Tec:TweenPosition(UDim2.new(1,-10,1,-10),Enum.EasingDirection.Out,Enum.EasingStyle.Back,0.3,true)
- for i=1,3 do
- clon.Tec.BackgroundColor3 = Color3.fromRGB(255,0,0)
- wait(.3)
- clon.Tec.BackgroundColor3 = Color3.fromRGB(0,0,0)
- wait(.3)
- end
- wait(3)
- clon.Tec:TweenPosition(UDim2.new(1,-10,1.1,-10),Enum.EasingDirection.In,Enum.EasingStyle.Back,0.5,true)
- wait(0.5)
- clon:Destroy()
- end))
- end
- end
- elseif message:lower() == ";clear" then
- for i,v in pairs(Player_.PlayerGui:GetChildren()) do
- if v.Name == "Request" or v.Name == "TicTacToe" then
- v:Destroy()
- end
- end
- end
- end))
- end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement