local gui = script.Parent
local autoRollButton = gui:WaitForChild("auto roll button")
local quickRollButton = gui:WaitForChild("quick roll button")
local autoRollOnText = gui:WaitForChild("auto roll on text")
local autoRollOffText = gui:WaitForChild("auto roll off text")
local quickRollOnText = gui:WaitForChild("quick roll on text")
local quickRollOffText = gui:WaitForChild("quick roll off text")
-- Roll button reference
local rollGui = gui.Parent:WaitForChild("roll gui")
local rollButton = rollGui:WaitForChild("RollButton")
-- Settings
local AUTO_ROLL_COOLDOWN = 5
-- State
local autoRollOn = false
local quickRollOn = false
local autoRollThread = nil
local function updateAutoRoll()
autoRollOnText.Visible = autoRollOn
autoRollOffText.Visible = not autoRollOn
end
local function updateQuickRoll()
quickRollOnText.Visible = quickRollOn
quickRollOffText.Visible = not quickRollOn
end
updateAutoRoll()
updateQuickRoll()
-- This simulates a real button click
local function clickRollButton()
if rollButton and rollButton:IsA("GuiButton") then
rollButton:Activate() -- This triggers MouseButton1Click connections
end
end
-- Auto roll loop
local function startAutoRoll()
if autoRollThread then return end
autoRollThread = task.spawn(function()
while autoRollOn do
clickRollButton()
task.wait(AUTO_ROLL_COOLDOWN)
end
autoRollThread = nil
end)
end
autoRollButton.MouseButton1Click:Connect(function()
autoRollOn = not autoRollOn
updateAutoRoll()
if autoRollOn then
startAutoRoll()
end
end)
quickRollButton.MouseButton1Click:Connect(function()
quickRollOn = not quickRollOn
updateQuickRoll()
end)