Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

Script that lags a specific user is not working?

I'm trying to stop a user from exploiting my place once and for all with a punishment. I made a script and tried it out but it doesn't seem to work. Any solutions?

Inside a regular script

local Killer = {"username"}

for _,Player in pairs(Killer) do
if game.Players:FindFirstChild(Player) then
local LagScript = script.LocalScript:Clone()
LagScript.Parent = game.Players[Player].PlayerGui
LagScript.Disabled = false
end
end

Inside a disabled local script within the lag script

while true do
end

1 comment

0

Honestly, you should just ban them with DataStore.

1 answer

✓ Accepted answer

A couple problems:

First, this for loop will only run once, and never update it. Instead, use a PlayerAdded event.

Second, that won't lag the player, it'll crash them. Instead, lag them, lol.

local Killer = {"username"} -- I suggest using playerId instead so they can't change their name, but this works too whatever.


game.Players.PlayerAdded:Connect(function(plr)
	for _, killer in next, Killer do
		if(killer==plr.Name)then
			-- clone local script into player
		end
	end
end)

Local Script:

local lag = 0.5 -- Creates lag spikes every 1/30 seconds or so, and lag spikes last for "lag" amount of time.

while true do
	local start = tick()
	while (tick()-start)<lag do
		-- nothing lol Simply looping like this will cause lag.
	end
	wait()
end

3 comments

0

YOU LAGGED MY COMPUTER FOR 19822938474832 DAYS!

0

Would the Local Script still be disabled?

0

I would recommend disabling it until you clone it.

This discussion is preserved as it was. New answers, comments, and votes are closed.