So, i have a anti-cheat bypass for my game that only works for admins, and i was wondering if anyone knew how to make this part of the script cleaner due to it kinda triggering me due to everything being at the same line and multiple task waits / repeated lplr.Character.HumanoidRootPart.CFrame
segments
Can anyone help me do that?
The Script
local lplr = game.Players.LocalPlayer
local debounce = false
function admin_bypass(clr, clrx)
if not debounce then
local oldc = lplr.Character.HumanoidRootPart.CFrame
local part = Instance.new("Part")
part.Transparency = 1
part.CFrame = skyc
part.Size = Vector3.new(12, 0.1, 12)
lplr.Character.HumanoidRootPart.CFrame = game.Workspace.Teams["Team"..tostring(clr)].Badge.Base.CFrame
task.wait(0.5)
lplr.Character.HumanoidRootPart.CFrame = part.CFrame + Vector3.new(0,3,0)
task.wait(5)
lplr.Character.HumanoidRootPart.CFrame = game.Workspace.Teams["Team"..tostring(clrx)].Badge.Base.CFrame
task.wait(0.25)
lplr.Character.HumanoidRootPart.CFrame = oldc
debounce = true
end
end
coroutine.wrap(admin_bypass)("Red", "Blue")