Funny but fatal Bugs using FPS Unlocker

  1. What do you want to achieve?
    I’m making a basic bhop script, I want my game to be compatible with everyone, to be optimal and apart from that, be able to use the FPS Unlocker - I have a 144hz monitor, and believe me, it looks beautiful… but …

  2. What is the problem?
    The problem is that when using runservice (I don’t like using while true do) the loop is repeated a lot of times. Normally it should be repeated approximately 60 times. but it repeats itself 144 times APORX

And I want it to remain stable even if you use an FPS Unlocker.

Using FPS Unlocker:

Normal: (Sorry, its repeated)

This is the script:

local nameofscript = script.Name
local nameoffolderscripts = script.Parent.Name
local value = script.Parent.Parent.Parent.Values[nameofscript]

local l__LocalPlayer__1 = game:GetService("Players").LocalPlayer;
local v2 = l__LocalPlayer__1.Character or l__LocalPlayer__1.CharacterAdded:Wait();
local l__HumanoidRootPart__3 = v2:WaitForChild("Torso");
local v4 = Instance.new("BodyVelocity");
v4.Parent = l__HumanoidRootPart__3;
v4.Name = "bhop"
local u1 = nil;
local l__Humanoid__2 = v2:WaitForChild("Humanoid");
local u3 = false;

local function u4()
	u1 = l__Humanoid__2:GetState();
	if u1 ~= Enum.HumanoidStateType.Freefall then
		v4.MaxForce = Vector3.new(0, 0, 0);
		v4.Velocity = l__HumanoidRootPart__3.Velocity;
		u3 = false;
		return;
	end;
	v4.MaxForce = Vector3.new(5000, 50, 5000);
	if not u3 then
		v4.Velocity = v4.Velocity * value.Velocity.Value;
		u3 = true;
	end;
	v4.Velocity = v4.Velocity + l__Humanoid__2.MoveDirection * value.MoveDirection.Value;
end;


game:GetService("RunService").Heartbeat:connect(function()
	u4();

	local speed = l__HumanoidRootPart__3.Velocity.Magnitude;
	


	--script.Parent.Frame.Speed.Text = "Speed: ".. tostring(speed)
	--script.Parent.Frame.Velocity.Text = "Velocity: ".. tostring(v4.Velocity)
	--script.Parent.Frame.Direction.Text = "Direction: ".. tostring(l__Humanoid__2.MoveDirection)

	l__Humanoid__2.JumpPower = value.JumpPower.Value;
end);

l__Humanoid__2.UseJumpPower = true;

game:GetService("UserInputService").JumpRequest:Connect(function()
	l__Humanoid__2.JumpPower = value.JumpPower.Value;
end);



l__Humanoid__2.Died:Connect(function()
	v4:Destroy();
end);

1 Like

image
image
The script is a localscript. But didnt work

Consider using the deltaTime to either skip or reduce the amount added to the jumppower

5 Likes

Is that a Decompiled script from a diff game?

2 Likes

No, (i grabbed it from toolbox, but then i change the script)

What do you mean it didnt work?

Using runservice and fps unlocker makes this: repeat every second 144 times

this is where the delta argument in Heartbeat comes in handy

here, you can do this instead

local function u4(delta)
	local magic = delta*60 -- lol. i think this is also called throttling, i'm not too sure myself.
	-- in any case, now this magic is used like a multiplier. If you're at 60 fps, magic will be 1. If you're at 30 fps, magic is 2, at 240 fps, magic is 0.25, etc etc.
	-- no, magic isn't the proper term for it. I'm just calling it that for s**ts and giggles
	u1 = l__Humanoid__2:GetState();
	if u1 ~= Enum.HumanoidStateType.Freefall then
		v4.MaxForce = Vector3.zero; -- yes Vector3.zero is a thing.
		v4.Velocity = l__HumanoidRootPart__3.Velocity;
		u3 = false;
		return;
	end;
	v4.MaxForce = Vector3.new(5000, 50, 5000);
	if not u3 then
		v4.Velocity *= value.Velocity.Value * magic;
		u3 = true;
	end;
	v4.Velocity += l__Humanoid__2.MoveDirection * value.MoveDirection.Value * magic;
end;


game:GetService("RunService").Heartbeat:Connect(function(delta) -- :Connect instead of :connect, :connect is deprecated.
	u4(delta);
	local speed = l__HumanoidRootPart__3.Velocity.Magnitude;
	l__Humanoid__2.JumpPower = value.JumpPower.Value;
end);
1 Like

I know thats why you use deltatime

I also think this It looks A LOT like it

Thanks, but also its not working at all, if i put the FPS Cap in 144, it getting slower, and fps cap 30, it gets faster

try removing one of the * magic in my code block? idk which one to remove cuz the variable names in your script confuse me a little

1 Like

Thanks you!, How works deltatime?

local nameofscript = script.Name
local nameoffolderscripts = script.Parent.Name
local value = script.Parent.Parent.Parent.Values[nameofscript]

local LocalPlayer = game:GetService("Players").LocalPlayer;
local Character = LocalPlayer.Character or LocalPlayer.CharacterAdded:Wait();
local HumanoidRootPart = Character:WaitForChild("Torso");
local BodyVelocity = Instance.new("BodyVelocity"); --v4
BodyVelocity.Parent = HumanoidRootPart;
BodyVelocity.Name = "bhop"
--local u1 = nil;
local Humanoid = Character:WaitForChild("Humanoid");
local VALUE = false;



Humanoid.UseJumpPower = true;

game:GetService("UserInputService").JumpRequest:Connect(function()
	Humanoid.JumpPower = value.JumpPower.Value;
end);



Humanoid.Died:Connect(function()
	BodyVelocity:Destroy();
end);


local function changevelocity(delta)
	local magic = delta*60 -- lol. i think this is also called throttling, i'm not too sure myself.
	-- in any case, now this magic is used like a multiplier. If you're at 60 fps, magic will be 1. If you're at 30 fps, magic is 2, at 240 fps, magic is 0.25, etc etc.
	-- no, magic isn't the proper term for it. I'm just calling it that for s**ts and giggles
	local state = Humanoid:GetState(); --u1
	if state ~= Enum.HumanoidStateType.Freefall then
		BodyVelocity.MaxForce = Vector3.zero; -- yes Vector3.zero is a thing.
		BodyVelocity.Velocity = HumanoidRootPart.Velocity;
		VALUE = false;
		return;
	end;
	BodyVelocity.MaxForce = Vector3.new(5000, 50, 5000);
	if not VALUE then
		BodyVelocity.Velocity *= value.Velocity.Value * 1.2 --* magic;
		VALUE = true;
	end;
	HumanoidRootPart.Velocity += Humanoid.MoveDirection * value.MoveDirection.Value *1.2 --* magic;
end;


game:GetService("RunService").Heartbeat:Connect(function(delta) -- :Connect instead of :connect, :connect is deprecated.
	changevelocity(delta);
	local speed = HumanoidRootPart.Velocity.Magnitude;
	Humanoid.JumpPower = value.JumpPower.Value;
end);

fps unlocker change fflag zaza

also i know thats a synapse X saved script??

As an anticheat developer and former Synapse user, this is definitely a decompiled script. Can you link where you got it so I can investigate it?

I just grabbed the script from Toolbox.

1 Like

Now seeing, yes, it was decompiled :skull:
I use Gravity 50. This is original script


-- Decompiled with the Synapse X Luau decompiler.

local l__LocalPlayer__1 = game:GetService("Players").LocalPlayer;
local v2 = l__LocalPlayer__1.Character or l__LocalPlayer__1.CharacterAdded:Wait();
local l__HumanoidRootPart__3 = v2:WaitForChild("HumanoidRootPart");
local v4 = Instance.new("BodyVelocity");
v4.Parent = l__HumanoidRootPart__3;
local u1 = nil;
local l__Humanoid__2 = v2:WaitForChild("Humanoid");
local u3 = false;
canjump = 10;
local function u4()
	u1 = l__Humanoid__2:GetState();
	if u1 ~= Enum.HumanoidStateType.Freefall then
		v4.MaxForce = Vector3.new(0, 0, 0);
		v4.Velocity = l__HumanoidRootPart__3.Velocity;
		u3 = false;
		return;
	end;
	v4.MaxForce = Vector3.new(5000, 0, 5000);
	if not u3 then
		v4.Velocity = v4.Velocity * 1.25;
		u3 = true;
	end;
	v4.Velocity = v4.Velocity + l__Humanoid__2.MoveDirection * ;
end;
game:GetService("RunService").RenderStepped:Connect(function()
	u4();
	canjump = math.clamp(canjump - 1, 0, 10);
end);
l__Humanoid__2.UseJumpPower = true;
game:GetService("UserInputService").JumpRequest:Connect(function()
	if canjump == 0 then
		l__Humanoid__2.JumpPower = 40;
	else
		l__Humanoid__2.JumpPower = 0;
	end;
	canjump = 10;
end);
l__Humanoid__2.Died:Connect(function()
	v4:Destroy();
end);



--------------------- Mobile fixer ---------------------------

game:GetService("RunService").RenderStepped:Connect(function()
	if canjump == 10 then
		l__Humanoid__2.JumpPower = 40;
	end
end)

--------------------------------------------------------------
1 Like

deltatime is just the time passed from previous frame to current frame
if you’re at 120 fps, deltatime will be 1/120 seconds and so on

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.