Ban Level 1: The anti teleport cage (for less advanced roblox exploits)

I made a jail that is made to punish the player that try to go out of the jail by loop killing them using distance. I think it prevent pretty well exploiters to go out and kill player with anti tp exploits too. I make the script free to use for everyone.

local JailBannedUsers = {"MagicLuau"}
local DistanceCalled = {}

local function UnbanPlayer(player:Player)
	if table.find(JailBannedUsers,player.Name) then
		table.remove(JailBannedUsers,table.find(JailBannedUsers,player.Name))
	end
	
	player.Character.Humanoid.Health = 0
	DistanceCalled[player.UserId] = nil
end

game:GetService("ServerStorage").BindableEvents.UnJailBanPlayer.Event:Connect(function(player)
	if not player:IsA("Player") then
		return
	end
	
	UnbanPlayer(player)
end)

while wait() do
	local sucess,errorm = pcall(function()
		for _, player in game.Players:GetPlayers() do
			if table.find(JailBannedUsers,player.Name) then
				local distancebymagnitude =  (player.Character.HumanoidRootPart.Position - game.Workspace.Jail.Bottom.Position).Magnitude

				if distancebymagnitude > 10 then
					if DistanceCalled[player.UserId] then
						if tick() - DistanceCalled[player.UserId] < 1 then
							-- Kill player
							player.Character.Humanoid.Health = 0
							DistanceCalled[player.UserId] = tick()
						else
							DistanceCalled[player.UserId] = tick()
						end 
					end
					
					if not DistanceCalled[player.UserId] then
						DistanceCalled[player.UserId] = tick()
					end
					
					player.Character.HumanoidRootPart.CFrame = game.Workspace.Jail.Bottom.CFrame + Vector3.new(0,2,0)

					task.wait(0.2)
					local distance  = (player.Character.HumanoidRootPart.Position - game.Workspace.Jail.Bottom.Position).Magnitude

					if distance > 10 then
						player.Character.Humanoid.Health = 0
					end
				end

				if distancebymagnitude > 5 then
					--player.Character.HumanoidRootPart.Anchored = true
					
					task.spawn(function()
						local success,errror = pcall(function()
							game.MarketplaceService:PromptProductPurchase(player,3144561327)
						end)
					end)
					
					player.Character.HumanoidRootPart.CFrame = game.Workspace.Jail.Bottom.CFrame + Vector3.new(0,2,0)
				end
			end
		end
	end)
end

What do you think of it? What could i improve?

2 Likes

Note dont dare use a tween to bypass this jail it wont work because you get too far of the jail.

I wonder if im allowed to use exploiters as a source of revenue like this:

2 Likes

here what happen if you try use a no teleport exploit

I mean, they will just probably use an alt account to continue exploiting. But I dunno, maybe there is somebody desperate enough to buy it. But would you really want your game to be pay2exploit?

The idea seems pretty nice, just easily bypassable. (Unless you can detect alt accounts.)

1 Like

I want my games to be safe and fun for others so by keeping the troubles element into charge in cage that solve my finance issue.

1 Like

can add a BanAsync on player removing, so if they leave and didnt pay they get banasync ban alt

2 Likes