Advertisement
1zxyuuki

Untitled

Aug 16th, 2024
24
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.67 KB | None | 0 0
  1. --[[
  2. WARNING: Heads up! This script has not been verified by ScriptBlox. Use at your own risk!
  3. ]]
  4. -- Variables to store the state
  5. local player = game.Players.LocalPlayer
  6. local UIS = game:GetService("UserInputService")
  7. local lastMovementTime = 0
  8.  
  9. -- Function to send notifications
  10. local function sendNotification(message)
  11. game.StarterGui:SetCore("SendNotification", {
  12. Title = "Spacebar Spam";
  13. Text = message;
  14. Duration = 2;
  15. })
  16. end
  17.  
  18. -- Initial notification to indicate the script is injected
  19. sendNotification("Injected")
  20.  
  21. -- Get the Key frame within the specific GUI
  22. local keyFrame = player:WaitForChild("PlayerGui"):WaitForChild("MainUI")
  23. :WaitForChild("Domain"):WaitForChild("Clashing")
  24. :WaitForChild("Key")
  25.  
  26. local lastPosition = keyFrame.AbsolutePosition
  27.  
  28.  
  29. local function spamSpacebar()
  30. local endTime = tick() + 3
  31. while tick() < endTime do
  32. game:GetService("VirtualInputManager"):SendKeyEvent(true, Enum.KeyCode.Space, false, game)
  33. wait(0.2) -- Adjust the speed of holding the spacebar here
  34. end
  35. game:GetService("VirtualInputManager"):SendKeyEvent(false, Enum.KeyCode.Space, false, game) -- Release the key after spamming
  36. end
  37.  
  38.  
  39. -- Loop to monitor the Key frame's position and trigger spacebar spam if it moves
  40. game:GetService("RunService").RenderStepped:Connect(function()
  41. local currentTime = tick()
  42. local currentPosition = keyFrame.AbsolutePosition
  43.  
  44. if currentPosition ~= lastPosition and (currentTime - lastMovementTime) > 30 then
  45. spamSpacebar()
  46. lastMovementTime = currentTime
  47. end
  48.  
  49. lastPosition = currentPosition
  50. end)
  51.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement