local UserInputService = game:GetService("UserInputService")
local VirtualInputManager = game:GetService("VirtualInputManager")
-- Function to simulate key press and release with a hold duration
local function simulateKeyPress(keyCode, holdDuration)
-- Default hold duration if not specified
holdDuration = holdDuration or 0
-- Press key down
VirtualInputManager:SendKeyEvent(true, keyCode, false, game)
-- If there's a hold duration, wait that amount of time
if holdDuration > 0 then
wait(holdDuration)
end
-- Release key
VirtualInputManager:SendKeyEvent(false, keyCode, false, game)
end
-- Function to simulate mouse click at specific coordinates
local function simulateMouseClick(x, y)
-- Convert screen coordinates to game window coordinates
VirtualInputManager:SendMouseButtonEvent(x, y, 0, true, game, 1)
VirtualInputManager:SendMouseButtonEvent(x, y, 0, false, game, 1)
end
-- Input handler for the F key
local function onInputBegan(input, gameProcessed)
-- Only handle if game hasn't already processed the input
if not gameProcessed then
-- Check if F key was pressed
if input.KeyCode == Enum.KeyCode.C then
print("F key pressed - executing sequence")
-- Simulate pressing the E key and holding it for 0.1 seconds
simulateKeyPress(Enum.KeyCode.E, 0.1)
-- Add a delay before clicking
wait(0.01)
-- Simulate mouse click at position (609, 555)
simulateMouseClick(1263, 385)
-- Add a delay before pressing E again
wait(0.1)
-- Simulate pressing E again with a 0.1 second hold
simulateKeyPress(Enum.KeyCode.E, 0.1)
-- Add a delay before the second click
wait(0.1)
-- Optional: Add a second click if needed
simulateMouseClick(1263, 385)
end
end
end
-- Connect the input handler
UserInputService.InputBegan:Connect(onInputBegan)
print("Fire loaded. Press F to activate the sequence.")
To embed this project on your website, copy the following code and paste it into your website's HTML: