script.Parent = workspace.DizzyKB
local Player = game:GetService("Players").LocalPlayer
	
local Char = Player.Character

local Mouse = Player:GetMouse()

script.Parent:WaitForChild("ArtificialHB")
script.Parent:WaitForChild("KeyDown")
script.Parent:WaitForChild("KeyUp")
script.Parent:WaitForChild("mousetarg")
script.Parent:WaitForChild("mousehit")
script.Parent:WaitForChild("mousepos")
script.Parent:WaitForChild("Button1Down")
Frame_Speed = 1 / 60
frame = Frame_Speed
tf = 0
allowframeloss = false
tossremainder = false
lastframe = tick()

Mouse.KeyDown:connect(function(k)
	script.Parent.KeyDown:FireServer(k)
end)

Mouse.KeyUp:connect(function(k)
	script.Parent.KeyUp:FireServer(k)
end)

Mouse.Button1Down:connect(function()
	script.Parent.Button1Down:FireServer()
end)

game:GetService("RunService").Heartbeat:connect(function(s, p)
	tf = tf + s
end)

while wait(Frame_Speed) do
	if tf >= frame then
		if allowframeloss then
			script.Parent.ArtificialHB:FireServer()
			script.Parent.mousepos:FireServer(Mouse.Hit,Mouse.Target)
			lastframe = tick()
		else
			for i = 1, math.floor(tf / frame) do
				script.Parent.ArtificialHB:FireServer()
				script.Parent.mousepos:FireServer(Mouse.Hit,Mouse.Target)
			end
		lastframe = tick()
		end
		if tossremainder then
			tf = 0
		else
			tf = tf - frame * math.floor(tf / frame)
		end
	end
end