local player = game:GetService("Players").LocalPlayer local gui = Instance.new("ScreenGui") gui.Name = "AbilityToggleUI" gui.Parent = player:WaitForChild("PlayerGui") local frame = Instance.new("Frame") frame.Size = UDim2.new(0, 200, 0, 50) frame.Position = UDim2.new(0.5, -100, 0.5, -25) frame.AnchorPoint = Vector2.new(0.5, 0.5) frame.BackgroundColor3 = Color3.fromRGB(40, 40, 40) frame.Parent = gui local button = Instance.new("TextButton") button.Size = UDim2.new(0.9, 0, 0.8, 0) button.Position = UDim2.new(0.05, 0, 0.1, 0) button.BackgroundColor3 = Color3.fromRGB(80, 80, 80) button.TextColor3 = Color3.fromRGB(255, 255, 255) button.Text = "OFF" button.Font = Enum.Font.SourceSansBold button.TextSize = 18 button.Parent = frame local isFiring = false local connection = nil button.MouseButton1Click:Connect(function() isFiring = not isFiring if isFiring then button.Text = "ON" button.BackgroundColor3 = Color3.fromRGB(0, 120, 0) connection = game:GetService("RunService").Heartbeat:Connect(function() game:GetService("ReplicatedStorage"):WaitForChild("AbilityRE"):FireServer() end) else button.Text = "OFF" button.BackgroundColor3 = Color3.fromRGB(80, 80, 80) if connection then connection:Disconnect() connection = nil end end end) gui.Destroying:Connect(function() if connection then connection:Disconnect() end end)