local Rayfield = loadstring(game:HttpGet('https://[Log in to view URL]'))()

local Window = Rayfield:CreateWindow({
   Name = "Punch Ball",
   LoadingTitle = "Maki Hub",
   LoadingSubtitle = "by CynoxHolo",
   ConfigurationSaving = {
      Enabled = false,
      FolderName = nil, -- Create a custom folder for your hub/game
      FileName = "Maki Hub"
   },
   Discord = {
      Enabled = false,
      Invite = "noinvitelink", -- The Discord invite code, do not include discord.gg/. E.g. discord.gg/ABCD would be ABCD
      RememberJoins = true -- Set this to false to make them join the discord every time they load it up
   },
   KeySystem = false, -- Set this to true to use our key system
   KeySettings = {
      Title = "Untitled",
      Subtitle = "Key System",
      Note = "No method of obtaining the key is provided",
      FileName = "Key", -- It is recommended to use something unique as other scripts using Rayfield may overwrite your key file
      SaveKey = true, -- The user's key will be saved, but if you change the key, they will be unable to use your script
      GrabKeyFromSite = false, -- If this is true, set Key below to the RAW site you would like Rayfield to get the key from
      Key = {"Hello"} -- List of keys that will be accepted by the system, can be RAW file links (pastebin, github etc) or simple strings ("hello","key22")
   }
})

local MainTab = Window:CreateTab("🏠Home", nil) -- Title, Image
local MainSection = MainTab:CreateSection("Main")

Rayfield:Notify({
   Title = "You successfully executed the script",
   Content = "Very good gui",
   Duration = 3,
   Image = nil,
   Actions = { -- Notification Buttons
      Ignore = {
         Name = "Okay!",
         Callback = function()
         print("The user tapped Okay!")
      end
   },
},
})

local Button = MainTab:CreateButton({
   Name = "Auto Punch",
   Callback = function()
   ;;;;;;;;;;;;;
;; OPTIONS ;;
;;;;;;;;;;;;;
global mouseDelay		:= "10"					;Delay between parries
global useTestBeep		:= "1"					;Enable test beeps

;;;;;;;;;;;;;;;;;;;;
;; SYSTEM GLOBALS ;;
;;;;;;;;;;;;;;;;;;;;
global isHoldingF		:= "0"					;The player is holding the F key
global parryType		:= "None"				;The parry to execute
global gameFPS			:= "60"					;Game's FPS
global gameTick			:= ((1/gameFPS)*1000)	;One gametick / frame

;;;;;;;;;;;;;;;
;; FUNCTIONS ;;
;;;;;;;;;;;;;;;
tick(t:="1"){							;; TICK FUNCTION ;;
	ticks := gameTick*t					;Set "Ticks" value to GameTicks times passed tick count value.
	return ticks						;Return the "Ticks value."
	}

testBeep(freq:="0", duration:="0"){		;; TEST BEEP FUNCTION ;;
	if useTestBeep{						;If useTestBeeps variable is 1,
		Soundbeep, freq, duration		;Play a beep based on the passed frequency/duration values.
		}
	return
	}

moveMouse(X:="0",Y:="0"){				;; MOVE MOUSE FUNCTION ;;
	testBeep(600, 15)					;Play mouse move beep,
	MouseMove, X, Y, mouseDelay, R		;Move the mouse based on passed X/Y/Duration values,
	setTimer, Parry, % tick(2)			;Return to Parry subroutine in 2 ticks.
	return
	}

Parry:									;; PARRY SUBROUTINE ;;
	{
	setTimer, Parry, off				;Disable the subroutine loop,
	if isHoldingF{						;If F is held,
		switch parryType{				;Look at the current ParryType value
			case "Up":					;For up,
				moveMouse(0, -50)		;Move mouse up
			case "Down":				;For down,
				moveMouse(0, 50)		;Move mouse down
			case "Left":				;For left,
				moveMouse(-50, 0)		;Move mouse left
			case "Right":				;For right,
				moveMouse(50, 0)		;Move mouse right
			case "None":				;For none,
				testBeep(300, 30)		;Play exit beep,
				setTimer, Parry, off	;Disable the loop
			default:					;Fallback,
				testBeep(150, 45)		;Play error beep,
				setTimer, Parry, off	;Disable the loop
			}
		}
	return
	}

;;;;;;;;;;;;;;
;; BINDINGS ;;
;;;;;;;;;;;;;;
F5::									;; F5 PRESS ;;
	send {F5}							;Sent vanilla F5 keystroke.
	reload								;Reload the script.
	return

$F::									;F PRESS ($ prefix) ;;
	if !isHoldingF{						;If "IsHoldingF" is false,
		testBeep(1800, 15)				;Play the F Pressed beep.
		isHoldingF := "1"				;Set "IsHoldingF" check to true.
		}
	return

*$~F Up::								;; F RELEASE (*$~ prefix) ;;
	testBeep(900, 30)					;Play the F Released beep.
	isHoldingF := "0"					;Set "IsHoldingF" check to false.
	return

$W::									;; W PRESS ($ prefix) ;;
	if isHoldingF{						;If F is held,
		ParryType := "Up"				;Set parry type to "Up",
		goSub Parry						;Go to the parry subroutine.
		}
	else if !isHoldingF{				;Otherwise, if F is NOT held,
		send {w}						;Send vanilla "W" keystroke.
		}
	return

$A::									;; A PRESS ($ prefix) ;;
	if isHoldingF{						;If F is held,
		parryType := "Left"				;Set parry type to "Left",
		goSub Parry						;Go to the parry subroutine.
		}
	else if !isHoldingF{				;Otherwise, if F is NOT held,
		send {a}						;Send vanilla "A" keystroke.
		}
	return

$S::									;; S PRESS ($ prefix) ;;
	if isHoldingF{						;If F is held,
		parryType := "Down"				;Set parry type to "Down",
		goSub Parry						;Go to the parry subroutine.
		}
	else if !isHoldingF{				;Otherwise, if F is NOT held,
		send {s}						;Send vanilla "S" keystroke.
		}		
	return

$D::									;; D PRESS ($ prefix) ;;
	if isHoldingF{						;If F is held,
		parryType := "Right"			;Set parry type to "Right",
		goSub Parry						;Go to the parry subroutine
		}                               
	else if !isHoldingF{				;Otherwise, if F is NOT held,
		send {d}						;Send vanilla "D" keystroke
		}
	return

*$~W up::
*$~S up::
*$~A up::
*$~D up::								;; W, S, A, D RELEASES ;;
	if isHoldingF{						;If F is held,
		testBeep(220, 30)				;Play key release beep.
		}
	parryType := "None"					;Unset the ParryType value.
	return
   end,
})

Embed on website

To embed this project on your website, copy the following code and paste it into your website's HTML: