Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local Players = game:GetService("Players")
- local RunService = game:GetService("RunService")
- local player = Players.LocalPlayer
- local character = player.Character or player.CharacterAdded:Wait()
- local function setupCharacter(char)
- -- Desactivar colisión con otros jugadores
- local function updateCollision()
- for _, otherPlayer in ipairs(Players:GetPlayers()) do
- if otherPlayer ~= player and otherPlayer.Character then
- local otherHumanoidRootPart = otherPlayer.Character:FindFirstChild("HumanoidRootPart")
- if otherHumanoidRootPart then
- otherHumanoidRootPart.CanCollide = false
- end
- end
- end
- end
- -- Prevenir caídas
- local function preventFalling()
- local humanoid = char:FindFirstChild("Humanoid")
- if humanoid then
- humanoid.PlatformStand = false
- humanoid:SetStateEnabled(Enum.HumanoidStateType.FallingDown, false)
- humanoid:SetStateEnabled(Enum.HumanoidStateType.Ragdoll, false)
- end
- local humanoidRootPart = char:FindFirstChild("HumanoidRootPart")
- if humanoidRootPart then
- humanoidRootPart.CanCollide = true
- if humanoidRootPart.Position.Y < 0 then
- humanoidRootPart.CFrame = CFrame.new(humanoidRootPart.Position.X, 0, humanoidRootPart.Position.Z)
- end
- end
- end
- RunService.Heartbeat:Connect(function()
- updateCollision()
- preventFalling()
- end)
- end
- setupCharacter(character)
- player.CharacterAdded:Connect(function(newCharacter)
- character = newCharacter
- setupCharacter(character)
- end)
- print("Script de no colisión y anti-caída activado")
- -- Inicialización de variables globales con valores predeterminados
- _G.enableLockt6kla = _G.enableLockt6kla or false
- _G.KEY = _G.KEY or "q"
- _G.PART = _G.PART or "HumanoidRootPart"
- _G.PRED = _G.PRED or 0.1
- _G.USE_PING = _G.USE_PING or true
- _G.SMOOTH = _G.SMOOTH or 0.1
- _G.MIN_DISTANCE = _G.MIN_DISTANCE or 5
- _G.MAX_VELOCITY_ADJUSTMENT = _G.MAX_VELOCITY_ADJUSTMENT or 50
- local Players = game:GetService("Players")
- local RunService = game:GetService("RunService")
- local camera = game.Workspace.CurrentCamera
- local localPlayer = Players.LocalPlayer
- local targetPlayer
- local isTracking = false
- local pingPrediction = _G.PRED
- local mouse = localPlayer:GetMouse()
- local markerPart = Instance.new("Part", game.Workspace)
- markerPart.Anchored = true
- markerPart.CanCollide = false
- markerPart.Transparency = 1 -- Invisible
- markerPart.Size = Vector3.new(0.2, 0.2, 0.2)
- -- Obtener ping y calcular predicción
- RunService.Heartbeat:Connect(function()
- if not _G.enableLockt6kla then return end
- if _G.USE_PING then
- local pingValue = tonumber(game:GetService("Stats").Network.ServerStatsItem["Data Ping"]:GetValueString():match("%d+"))
- pingPrediction = (pingValue / 1000) + _G.PRED
- else
- pingPrediction = _G.PRED
- end
- end)
- -- Anti-Antilocks
- RunService.Heartbeat:Connect(function()
- if not _G.enableLockt6kla then return end
- pcall(function()
- for _, player in ipairs(Players:GetPlayers()) do
- if player ~= localPlayer and player.Character and player.Character:FindFirstChild(_G.PART) then
- local hrp = player.Character[_G.PART]
- local velocityAdjustment = hrp.Velocity * pingPrediction
- -- Limitar velocidad máxima
- if velocityAdjustment.Magnitude > _G.MAX_VELOCITY_ADJUSTMENT then
- velocityAdjustment = velocityAdjustment.Unit * _G.MAX_VELOCITY_ADJUSTMENT
- end
- hrp.Velocity = hrp.Velocity + velocityAdjustment
- end
- end
- end)
- end)
- -- Predicción segura sin colisiones
- function getPredictedPosition(targetPart)
- local velocity = targetPart.Velocity
- local adjustedVelocity = velocity * pingPrediction
- if adjustedVelocity.Magnitude > _G.MAX_VELOCITY_ADJUSTMENT then
- adjustedVelocity = adjustedVelocity.Unit * _G.MAX_VELOCITY_ADJUSTMENT
- end
- return targetPart.Position + adjustedVelocity
- end
- -- Ajustar rotación de la cámara
- function adjustCameraRotation(predictedPosition)
- local cameraPosition = camera.CFrame.Position
- local directionToTarget = (predictedPosition - cameraPosition).Unit
- local targetCFrame = CFrame.new(cameraPosition, cameraPosition + directionToTarget)
- local distanceToTarget = (cameraPosition - predictedPosition).Magnitude
- if distanceToTarget < _G.MIN_DISTANCE then
- predictedPosition = cameraPosition + directionToTarget * _G.MIN_DISTANCE
- end
- camera.CFrame = camera.CFrame:Lerp(targetCFrame, _G.SMOOTH)
- end
- -- Actualizar marcador y cámara
- RunService.RenderStepped:Connect(function()
- if not _G.enableLockt6kla then return end
- if isTracking and targetPlayer and targetPlayer.Character then
- local humanoid = targetPlayer.Character:FindFirstChild("Humanoid")
- if not humanoid or humanoid.Health < 10 then
- isTracking = false
- targetPlayer = nil
- print("Seguimiento desactivado: objetivo muerto o con poca vida")
- return
- end
- local targetPart = targetPlayer.Character:FindFirstChild(_G.PART)
- if targetPart then
- local predictedPosition = getPredictedPosition(targetPart)
- markerPart.Position = predictedPosition
- adjustCameraRotation(predictedPosition)
- else
- isTracking = false
- targetPlayer = nil
- print("Seguimiento desactivado: parte objetivo no encontrada")
- end
- else
- markerPart.Position = Vector3.new(0, -1000, 0)
- end
- end)
- -- Alternar seguimiento con la tecla asignada
- mouse.KeyDown:Connect(function(key)
- if not _G.enableLockt6kla then return end
- if key:lower() == _G.KEY then
- if isTracking then
- isTracking = false
- targetPlayer = nil
- print("Seguimiento desactivado")
- else
- targetPlayer = getClosestPlayer()
- if targetPlayer then
- isTracking = true
- print("Siguiendo a:", targetPlayer.Name)
- else
- print("No se encontró ningún jugador cercano")
- end
- end
- end
- end)
- -- Obtener el jugador más cercano
- function getClosestPlayer()
- local closestPlayer = nil
- local shortestDistance = math.huge
- for _, player in ipairs(Players:GetPlayers()) do
- if player ~= localPlayer and player.Character and
- player.Character:FindFirstChild("Humanoid") and player.Character.Humanoid.Health > 10 and
- player.Character:FindFirstChild(_G.PART) then
- local targetPart = player.Character[_G.PART]
- local screenPoint = camera:WorldToViewportPoint(targetPart.Position)
- local distance = (Vector2.new(screenPoint.X, screenPoint.Y) - Vector2.new(mouse.X, mouse.Y)).Magnitude
- if distance < shortestDistance then
- closestPlayer = player
- shortestDistance = distance
- end
- end
- end
- return closestPlayer
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement