Possible/How to generate high ping on the client

Hello!

I have been reading a lot of the dev forum and my brain generated a question:

Would it be possible to simulate high ping on the client? If so, how would I do it?

Thanks

1 Like

Do you mean to lag the client or slow the server?

1 Like

As in the ping - for you - would spike up and you would experience ping lag. This wouldn’t happen on the server (or at least will not affect other players)

1 Like

why do you need to do this? the only use i see for this would be exploits, which in that case this post should be removed

1 Like

To punish exploiters. It would lag them for a bit - then kick and ban them.

you could just run a loop

while true do
task.wait()
local part = Instance.new("Part")
part.Parent = workspace
end

or if you want to crash them remove the task.wait()

I’d probably do something more like this:

for i=1,math.huge do
	Instance.new('Part',workspace):Destroy()
	if i%500==0 then
		task.wait()
	end
end

The higher the number, the laggier it’ll be. 500 seems to be good, 1000 will probably get near crashing or freezing up.

You can hook this up with an FPS function to create the desired framerate. I think some games did this to emulate the 30 FPS cap of classic Roblox?

you can easily cap the fps by doing this:

local RunService = game:GetService("RunService")
local MaxFPS = 61
while true do
	local t0 = tick()
	RunService.Heartbeat:Wait()
	repeat until (t0 + 1/MaxFPS) < tick()
end

you definitely do not want to cap the fps by making the game laggy, thats literally the worst possible way to do this

i guess you could, i just used a while loop and created a new part so it would lag the player, and parented it to workspace to make it actually appear, but your way of deleting it after making a part seems pretty smart

3 Likes

That’s much simpler than what I had in mind. Although I think you’ll want to use RenderStepped instead (unless doing it on the server)?

But is that just yielding until the cap has been met, or is that consistently reducing the FPS?

this basically repeats adding the (t0) and + 1 then dividing the maxFPS until its less then tick()

tbh it should be stepped cause its on the client

1 Like