Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --[[ WARNING: Heads up! This script has not been verified by ScriptBlox. Use at your own risk! ]]
- local activated = false
- -- Function to simulate pressing the F key
- local function pressFKey()
- local inputService = game:GetService("VirtualInputManager")
- inputService:SendKeyEvent(true, Enum.KeyCode.F, false, game) -- Key down
- inputService:SendKeyEvent(false, Enum.KeyCode.F, false, game) -- Key up
- end
- -- Function to toggle the automation
- local function toggle()
- activated = not activated
- game.StarterGui:SetCore("SendNotification", {
- Title = "Key Spam",
- Text = activated and "Enabled" or "Disabled",
- Duration = 5,
- })
- if activated then
- spawn(function()
- while activated do
- pressFKey() -- Simulate pressing the F key
- task.wait() -- Natural delay based on Roblox's frame rate
- end
- end)
- end
- end
- -- Detect key press to toggle the automation
- game:GetService("UserInputService").InputBegan:Connect(function(input, gameProcessed)
- if not gameProcessed and input.KeyCode == Enum.KeyCode.X then
- toggle()
- end
- end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement