local Players = game:GetService("Players")
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local LocalPlayer = Players.LocalPlayer
local UserInputService = game:GetService("UserInputService")
local Remotes = ReplicatedStorage:WaitForChild("Remotes")
local SubmitAnswer = Remotes:WaitForChild("SubmitAnswer")
local autoGuess = true
local hasGuessed = false
local currentAnswer = ""
local screenGui = Instance.new("ScreenGui")
screenGui.Name = "AutoGuesser"
screenGui.ResetOnSpawn = false
screenGui.Parent = LocalPlayer:WaitForChild("PlayerGui")
local frame = Instance.new("Frame")
frame.Size = UDim2.new(0, 200, 0, 50)
frame.Position = UDim2.new(0.5, -100, 0, 50)
frame.BackgroundColor3 = Color3.fromRGB(0, 0, 0)
frame.BackgroundTransparency = 0.5
frame.BorderSizePixel = 0
frame.Parent = screenGui
local corner = Instance.new("UICorner")
corner.CornerRadius = UDim.new(0, 8)
corner.Parent = frame
local statusLabel = Instance.new("TextLabel")
statusLabel.Size = UDim2.new(1, 0, 1, 0)
statusLabel.BackgroundTransparency = 1
statusLabel.Text = "Auto-Guess: ON"
statusLabel.TextColor3 = Color3.fromRGB(0, 255, 0)
statusLabel.Font = Enum.Font.GothamBold
statusLabel.TextSize = 14
statusLabel.Parent = frame
local dragging = false
local dragStart, startPos
frame.InputBegan:Connect(function(input)
if input.UserInputType == Enum.UserInputType.MouseButton1 then
dragging = true
dragStart = input.Position
startPos = frame.Position
end
end)
frame.InputEnded:Connect(function(input)
if input.UserInputType == Enum.UserInputType.MouseButton1 then
dragging = false
end
end)
UserInputService.InputChanged:Connect(function(input)
if dragging and input.UserInputType == Enum.UserInputType.MouseMovement then
local delta = input.Position - dragStart
frame.Position = UDim2.new(startPos.X.Scale, startPos.X.Offset + delta.X, startPos.Y.Scale, startPos.Y.Offset + delta.Y)
end
end)
UserInputService.InputBegan:Connect(function(input, processed)
if processed then return end
if input.KeyCode == Enum.KeyCode.G then
autoGuess = not autoGuess
statusLabel.Text = autoGuess and "Auto-Guess: ON" or "Auto-Guess: OFF"
statusLabel.TextColor3 = autoGuess and Color3.fromRGB(0, 255, 0) or Color3.fromRGB(255, 0, 0)
print("[AutoGuesser]", autoGuess and "Enabled" or "Disabled")
end
end)
SubmitAnswer.OnClientEvent:Connect(function(success, answer)
if not success then return end
currentAnswer = answer
print("[AutoGuesser] Received correct answer:", currentAnswer)
if autoGuess and not hasGuessed then
hasGuessed = true
task.wait(1.9)
SubmitAnswer:FireServer("Submit", currentAnswer)
print("[AutoGuesser] Submitted answer:", currentAnswer)
task.wait(5)
hasGuessed = false
end
end)
print("Press G to toggle auto-guess")an auto guesser for Guess The Flag ๐
toggle auto guesser on and off by pressing G
No comments yet. Be the first to comment!
1local Players = game:GetService("Players")
2local ReplicatedStorage = game:GetService("ReplicatedStorage")
3local LocalPlayer = Players.LocalPlayer
4local UserInputService = game:GetService("UserInputService")
5
6local Remotes = ReplicatedStorage:WaitForChild("Remotes")
7local SubmitAnswer = Remotes:WaitForChild("SubmitAnswer")
8
9local autoGuess = true
10local hasGuessed = false
11local currentAnswer = ""
12
13local screenGui = Instance.new("ScreenGui")
14screenGui.Name = "AutoGuesser"
15screenGui.ResetOnSpawn = false
16screenGui.Parent = LocalPlayer:WaitForChild("PlayerGui")
17
18local frame = Instance.new("Frame")
19frame.Size = UDim2.new(0, 200, 0, 50)
20frame.Position = UDim2.new(0.5, -100, 0, 50)
21frame.BackgroundColor3 = Color3.fromRGB(0, 0, 0)
22frame.BackgroundTransparency = 0.5
23frame.BorderSizePixel = 0
24frame.Parent = screenGui
25
26local corner = Instance.new("UICorner")
27corner.CornerRadius = UDim.new(0, 8)
28corner.Parent = frame
29
30local statusLabel = Instance.new("TextLabel")
31statusLabel.Size = UDim2.new(1, 0, 1, 0)
32statusLabel.BackgroundTransparency = 1
33statusLabel.Text = "Auto-Guess: ON"
34statusLabel.TextColor3 = Color3.fromRGB(0, 255, 0)
35statusLabel.Font = Enum.Font.GothamBold
36statusLabel.TextSize = 14
37statusLabel.Parent = frame
38
39local dragging = false
40local dragStart, startPos
41frame.InputBegan:Connect(function(input)
42 if input.UserInputType == Enum.UserInputType.MouseButton1 then
43 dragging = true
44 dragStart = input.Position
45 startPos = frame.Position
46 end
47end)
48frame.InputEnded:Connect(function(input)
49 if input.UserInputType == Enum.UserInputType.MouseButton1 then
50 dragging = false
51 end
52end)
53UserInputService.InputChanged:Connect(function(input)
54 if dragging and input.UserInputType == Enum.UserInputType.MouseMovement then
55 local delta = input.Position - dragStart
56 frame.Position = UDim2.new(startPos.X.Scale, startPos.X.Offset + delta.X, startPos.Y.Scale, startPos.Y.Offset + delta.Y)
57 end
58end)
59
60UserInputService.InputBegan:Connect(function(input, processed)
61 if processed then return end
62 if input.KeyCode == Enum.KeyCode.G then
63 autoGuess = not autoGuess
64 statusLabel.Text = autoGuess and "Auto-Guess: ON" or "Auto-Guess: OFF"
65 statusLabel.TextColor3 = autoGuess and Color3.fromRGB(0, 255, 0) or Color3.fromRGB(255, 0, 0)
66 print("[AutoGuesser]", autoGuess and "Enabled" or "Disabled")
67 end
68end)
69
70SubmitAnswer.OnClientEvent:Connect(function(success, answer)
71 if not success then return end
72 currentAnswer = answer
73 print("[AutoGuesser] Received correct answer:", currentAnswer)
74
75 if autoGuess and not hasGuessed then
76 hasGuessed = true
77 task.wait(1.9)
78 SubmitAnswer:FireServer("Submit", currentAnswer)
79 print("[AutoGuesser] Submitted answer:", currentAnswer)
80 task.wait(5)
81 hasGuessed = false
82 end
83end)
84
85
86print("Press G to toggle auto-guess")