Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- 28/2/2023: last exploit(s) before going home tomorrow
- COIN_TYPE = {'BeachBall'}
- myplr = game.Players.LocalPlayer
- cam = workspace.CurrentCamera
- uis = game:GetService('UserInputService')
- pathfinder = game:GetService('PathfindingService')
- tweener = game:GetService('TweenService')
- vim = game:GetService('VirtualInputManager')
- run = game:GetService('RunService')
- for i,v in pairs(workspace:GetDescendants()) do
- if v.Name == 'CoinContainer' then
- container = v
- break
- end
- end
- spawn(function()
- while wait(2) do
- if stop then break end
- -- prevent 20 minutes idle disconnection
- if not hasgun then
- vim:SendMouseButtonEvent(0,0,0, true, game,1)
- vim:SendMouseButtonEvent(0,0,0, false, game,1)
- end
- for i,v in pairs(workspace:GetDescendants()) do
- if v.Name == 'CoinContainer' then
- container = v
- break
- end
- end
- end
- end)
- --/////////////////////////////////////////
- event = nil
- stop = false
- event = uis.InputBegan:Connect(function(input,gpe)
- if gpe then return end
- if input.KeyCode == Enum.KeyCode.X then
- stop = true
- end
- end)
- --/////////////////////////////////////////////////////////
- function createPath(from,to)
- local agentParams = {
- AgentHeight = 2.5,
- AgentRadius = 2,
- AgentCanJump = true
- }
- local path = pathfinder:CreatePath(agentParams)
- path:ComputeAsync(from,to)
- if path.Status == Enum.PathStatus.Success then
- local waypoints = path:GetWaypoints()
- return path,waypoints
- end
- end
- function insight(from,target) -- make sure no players see us or we'll be accused of cheating
- for i,plr in pairs(game.Players:GetChildren()) do
- if plr ~= myplr then
- local params = RaycastParams.new()
- params.FilterType = Enum.RaycastFilterType.Exclude
- params.FilterDescendantsInstances = {myplr.Character}
- local result = workspace:Raycast(from, (target.Position-from).Unit*150, params)
- if result and result.Instance then
- if result.Instance == target or result.Instance:IsDescendantOf(target) then
- return true
- end
- end
- end
- end
- end
- --////////////////////////////////////////////
- clip = true
- function Nocl()
- if game.Players.LocalPlayer.Character ~= nil then
- for _,v in pairs(game.Players.LocalPlayer.Character:GetDescendants()) do
- if v:IsA("BasePart") and (v.CanCollide or v.Name == 'HumanoidRootPart' or v.Name == 'UpperTorso' or v.Name == 'LowerTorso') then
- v.CanCollide = clip == true and true or false
- end
- end
- end
- wait(0.21) -- basic optimization
- end
- Noclip = game:GetService('RunService').Stepped:Connect(Nocl)
- --////////////////////////////////////////////////////////
- killer = nil
- spawn(function()
- while not stop do
- wait()
- for i,plr in pairs(game.Players:GetChildren()) do
- if plr ~= myplr and plr.Character and plr.Character:FindFirstChild('Knife') then
- killer = plr.Character
- end
- end
- end
- end)
- function killerinsight()
- local result = workspace:Raycast(cam.CFrame.p, (killer.HumanoidRootPart.Position - cam.CFrame.p).Unit*150)
- return (result and result.Instance and result.Instance:IsDescendantOf(killer)) and true or false
- end
- --////////////////////////////////////////////////////////
- function isInLobby()
- if root and root.Parent then
- local touches = workspace:GetPartBoundsInBox(
- root.CFrame,
- Vector3.new(2,20,2)
- )
- for i,v in pairs(touches) do
- if v:IsDescendantOf(workspace.Lobby) then
- return true
- end
- end
- return false
- else -- root not found meaning that we just died and havent yet respawned into the lobby
- return true
- end
- end
- --////////////////////////////////////////////////////////
- function distanceToLine(point, lineStart, lineEnd)
- local vector = Vector3.new(
- lineEnd.X - lineStart.X,
- lineEnd.Y - lineStart.Y,
- lineEnd.Z - lineStart.Z
- )
- local pointVector = Vector3.new(
- point.X - lineStart.X,
- point.Y - lineStart.Y,
- point.Z - lineStart.Z
- )
- local vectorMagnitude = math.sqrt(vector.X^2 + vector.Y^2 + vector.Z^2)
- local normalizedVector = Vector3.new(vector.X / vectorMagnitude, vector.Y / vectorMagnitude, vector.Z / vectorMagnitude)
- local dotProduct = pointVector.X * normalizedVector.X + pointVector.Y * normalizedVector.Y + pointVector.Z * normalizedVector.Z
- local projectedPoint = Vector3.new(
- lineStart.X + dotProduct * normalizedVector.X,
- lineStart.Y + dotProduct * normalizedVector.Y,
- lineStart.Z + dotProduct * normalizedVector.Z
- )
- local distance = math.sqrt((projectedPoint.X - point.X)^2 + (projectedPoint.Y - point.Y)^2 + (projectedPoint.Z - point.Z)^2)
- -- Check if the projected point is within the line segment
- local lineLength = math.sqrt(vector.X^2 + vector.Y^2 + vector.Z^2) -- Calculate the line length
- local projectedDistanceToStart = math.sqrt((projectedPoint.X - lineStart.X)^2 + (projectedPoint.Y - lineStart.Y)^2 + (projectedPoint.Z - lineStart.Z)^2)
- local projectedDistanceToEnd = math.sqrt((projectedPoint.X - lineEnd.X)^2 + (projectedPoint.Y - lineEnd.Y)^2 + (projectedPoint.Z - lineEnd.Z)^2)
- local withinSegment = projectedDistanceToStart <= lineLength and projectedDistanceToEnd <= lineLength
- return distance, withinSegment
- end
- --////////////////////////////////////////////////////
- lastpos = nil
- lastcoin = nil
- tries = 0
- coin = nil
- cointable = {}
- count = 0
- while not stop do
- local succ, msg = pcall(function()
- if myplr.Character and container and container.Parent then
- root = myplr.Character:FindFirstChild('HumanoidRootPart')
- hum = myplr.Character:FindFirstChild('Humanoid')
- if root and hum then
- cointable = {}
- count = 0
- coin = nil
- for i,v in pairs(container:GetChildren()) do
- if v:FindFirstChild('Coin') then
- count = count + 1
- if table.find(COIN_TYPE, v.CoinType.Value) then
- local ele = {}
- ele.obj = v
- ele.dist1 = (v.Position - root.Position).Magnitude
- ele.dist2 = (killer and killer.Parent) and (v.Position - killer.HumanoidRootPart.Position).Magnitude or 300
- local dist3, inline
- if killer and killer.Parent then
- dist3, inline = distanceToLine(killer.HumanoidRootPart.Position, v.Position, root.Position)
- else
- dist3 = 300
- inline = false
- end
- ele.dist3 = dist3
- ele.inline = inline
- table.insert(cointable, ele)
- end
- end
- end
- local idk = nil
- if killer == nil then
- local mindist = 666
- for i,v in pairs(cointable) do
- if v.dist1 <= mindist then
- coin = v.obj
- mindist = v.dist1
- idk = v
- end
- end
- else
- local dangerdist = (killer ~= nil and killer.Parent ~= nil) and (root.Position - killer.HumanoidRootPart.Position).Magnitude or 300
- if dangerdist >= 60 then
- -- if killer is faraway, then get the nearest coin to us (that isnt close to the killer)
- local mindist = 666
- for i,v in pairs(cointable) do
- if v.dist3 >= 50 and not v.inline and v.dist2 >= 50 then -- we check how far the killer is from a LINE, not from a point anymore
- if v.dist1 <= mindist then
- coin = v.obj
- mindist = v.dist1
- idk = v
- end
- end
- end
- else
- -- if killer is near, then get the furthest coin from the killer
- local maxdist = 0
- for i,v in pairs(cointable) do
- if v.dist3 + v.dist2 >= maxdist and v.dist3 >= 50 then
- coin = v.obj
- maxdist = v.dist3 + v.dist2
- idk = v
- end
- end
- end
- end
- if coin == nil then -- if still nil, then just yolo and get any closest coin
- local mindist = 666
- for i,v in pairs(cointable) do
- if v.dist1 <= mindist then
- coin = v.obj
- mindist = v.dist1
- idk = v
- end
- end
- end
- if idk then
- print(idk.dist1, idk.dist2, idk.dist3, idk.inline)
- end
- if coin ~= nil then
- local path,waypoints = createPath(root.Position, coin.Position)
- if path and waypoints then
- print'path waypoint'
- clip = false
- lastpos = nil
- for i,waypoint in pairs(waypoints) do
- if hum.Health == 0 or root.Parent == nil or stop then break end
- local rootpos = root.Position
- local movepos = waypoint.Position + Vector3.new(0,2.5,0)
- local movedir = (movepos - rootpos).Unit
- tries = tries + 1
- if tries >= 4 then
- tries = 0
- if lastpos and (rootpos - lastpos).Magnitude < 2 then
- if lastcoin and lastcoin == coin then
- coin.Parent = nil -- cursed coin, cannot be collected
- lastcoin = nil
- break
- end
- end
- lastpos = root.Position
- end
- local bg = Instance.new('BodyGyro')
- bg.P = 10000
- bg.MaxTorque = Vector3.new(999999,999999,999999)
- local bp = Instance.new('BodyPosition')
- bp.P = 40000
- bp.MaxForce = Vector3.new(999999,999999,999999)
- bp.Position = movepos
- bp.Parent = root
- bg.CFrame = CFrame.new(rootpos, movepos)
- bg.Parent = root
- wait(.15)
- bp:Destroy()
- bg:Destroy()
- end
- clip = true
- lastcoin = coin
- else -- no path, then forced to fly over there
- print'no path'
- clip = false
- local rootpos = root.Position
- local movepos = coin.Position + Vector3.new(0,2,0)
- local bg = Instance.new('BodyGyro')
- bg.P = 10000
- bg.MaxTorque = Vector3.new(999999,999999,999999)
- bg.CFrame = CFrame.new(rootpos, movepos)
- bg.Parent = root
- local bv = Instance.new('BodyVelocity')
- bv.MaxForce = Vector3.new(999999,999999,999999)
- lastpos = nil
- repeat
- tries = tries + 1
- if tries >= 4 then
- tries = 0
- if lastpos and (rootpos - lastpos).Magnitude < 2 then
- if lastcoin and lastcoin == coin then
- coin.Parent = nil -- cursed coin, cannot be collected
- lastcoin = nil
- break
- end
- end
- lastpos = root.Position
- end
- bv.Velocity = (movepos - rootpos).Unit*26
- bv.Parent = root
- wait(.2)
- until (root.Position - rootpos).Magnitude >= (movepos - rootpos).Magnitude or hum.Health == 0 or stop
- bv:Destroy()
- bg:Destroy()
- clip = true
- lastcoin = coin
- end
- else -- either we are in the lobby or that bag is full
- if not isInLobby() and count == 0 then -- make sure that the below only trigger when bag is full
- if myplr.Backpack:FindFirstChild('Knife') then
- -- reset if we're the murderer
- hum:ChangeState(Enum.HumanoidStateType.Dead)
- else
- hasgun = false
- if myplr.Backpack:FindFirstChild('Gun') then
- hasgun = true
- else
- if workspace:FindFirstChild('GunDrop') then
- wait(2)
- root.CFrame = workspace.GunDrop.CFrame
- hasgun = true
- end
- end
- if hasgun and hum.Health > 0 and killer and killer.Parent then
- -- aim at killer and wait till killer appear in sight
- myplr.CameraMode = 'LockFirstPerson'
- repeat
- cam.CFrame = CFrame.new(cam.CFrame.p, killer.Head.Position)
- wait()
- until killerinsight() or stop or hum.Health == 0
- -- spam 1 until equip the gun
- repeat
- vim:SendKeyEvent(true, Enum.KeyCode.One, false, game)
- vim:SendKeyEvent(false, Enum.KeyCode.One, false, game)
- wait()
- until myplr.Character:FindFirstChild('Gun') or stop or hum.Health == 0
- myplr.Character.HumanoidRootPart.CFrame = killer.HumanoidRootPart.CFrame * CFrame.new(0,0,6)
- -- spam shoot until the game ends or we die
- while hum.Health > 0 and killer and killer.Parent and not stop do
- cam.CFrame = CFrame.new(cam.CFrame.p, killer.UpperTorso.Position)
- local vp = cam.ViewportSize
- vim:SendMouseButtonEvent(vp.X/2,vp.Y/2 , 0, true, game,1)
- vim:SendMouseButtonEvent(vp.X/2,vp.Y/2 , 0, false, game,1)
- run.Heartbeat:Wait()
- end
- myplr.CameraMode = 'Classic'
- end
- end
- end
- end
- end
- end
- end)
- if not succ then warn(msg) end
- wait()
- end
- event:Disconnect()
- Noclip:Disconnect()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement