Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --====================================================
- -- PRISON LIFE | DELTA MOBILE | SCRIPT FINAL (Tremor ao pegar armas + ESP robusto)
- -- Cole como LocalScript em StarterPlayer -> StarterPlayerScripts
- --====================================================
- -- Services
- local Players = game:GetService("Players")
- local RunService = game:GetService("RunService")
- local Workspace = game:GetService("Workspace")
- local UserInputService = game:GetService("UserInputService")
- local TweenService = game:GetService("TweenService")
- local HttpService = game:GetService("HttpService")
- local TeleportService = game:GetService("TeleportService")
- local Lighting = game:GetService("Lighting")
- local LP = Players.LocalPlayer
- repeat task.wait() until LP
- local PlayerGui = LP:WaitForChild("PlayerGui")
- local Camera = Workspace.CurrentCamera
- -- Feature detection
- local HAS_DRAWING = pcall(function() return typeof(Drawing) == "table" end)
- local HAS_RAWMT = pcall(function() return getrawmetatable and getrawmetatable(game) end)
- local HAS_NEWC = type(newcclosure) == "function"
- local HAS_FILE = (type(writefile)=="function" and type(readfile)=="function" and type(isfile)=="function")
- local CAN_HOOK = HAS_RAWMT and HAS_NEWC
- -- ================= SETTINGS (default: tudo OFF)
- local Settings = {
- SilentAim = false,
- ShowFOV = false,
- FOVRadius = 135,
- TargetPart = "Head",
- ESP = false,
- ESP_Name = false,
- ESP_Health = false,
- ESP_Line = false,
- ErrarTiros = false,
- ErrarBase = 0.26,
- ErrarMax = 0.45,
- ErrarJitter = 0.07,
- ErrarDistWeight = 0.12,
- ErrarTargetMoveWeight = 0.18,
- ErrarLocalMoveWeight = 0.12,
- ErrarCamMoveWeight = 0.12,
- ErrarShotStreakWeight = 0.05,
- ErrarShotWindow = 1.2,
- DelayFarTargets = false,
- DelayMean = 0.35,
- DelayJitter = 0.15,
- AutoPickWeapons = false,
- Mods_Weapons = { MP5=false, REMINGTON=false, M4A1=false, FAL=false, ["AK-47"]=false },
- TeamFilterEnabled = false,
- TeamFilter = { Guards=false, Inmates=false, Criminals=false },
- AutoLoadConfigs = false,
- Optimization = false,
- AutoReload = true,
- }
- local SilentAimSettings = {
- MaxDistance = 600,
- MISS_OFFSET_BASE = 1.6,
- PERSISTENCE_TIME = 1.0
- }
- -- ================= STATE
- local shotsFired = 0
- local targetEnterTime = {}
- local targetDeadline = {}
- local currentPlayer = nil
- local currentTargetPart = nil
- local lastSwitch = 0
- local deviationState = {}
- local recentShots = {}
- local perTargetProb = {}
- local camAngularSpeed = 0
- local lastCameraCFrame = Camera and Camera.CFrame or nil
- local cachedMissProb = 0
- local cachedMissTarget = nil
- -- ================= TELEPORTS / PICK LOCS
- local TELEPORT_CFRAMES = {
- MP5 = CFrame.new(813.77771, 101, 2229.31494, -0.223565266, 1.63104605e-08, 0.974688947, -1.0040615e-09, 1, -1.69643197e-08, -0.974688947, -4.77128026e-09, -0.223565266),
- REMINGTON = CFrame.new(819.945129, 101, 2229.5896, -0.304979891, 2.46256828e-08, -0.952358782, 5.93047815e-08, 1, 6.86602286e-09, 0.952358782, -5.43854313e-08, -0.304979891),
- M4A1 = CFrame.new(847.449097, 101, 2229.58618, 0.622228265, 1.86408489e-08, -0.782835841, -9.01549129e-08, 1, -4.78466653e-08, 0.782835841, 1.00348046e-07, 0.622228265),
- FAL = CFrame.new(-915.726562, 94.3527985, 2047.32214, -0.305260807, -8.88391725e-08, -0.952268779, -5.00594268e-08, 1, -7.72449908e-08, 0.952268779, 2.4090161e-08, -0.305260807),
- ["AK-47"] = CFrame.new(-939.100769, 94.4282608, 2039.23157, 0.630430043, -3.7999687e-08, 0.776246071, 2.66730336e-08, 1, 2.72905805e-08, -0.776246071, 3.50003582e-09, 0.630430043)
- }
- local LOCATION_CFRAMES = {
- ["Criminal Base"] = CFrame.new(-937.829041, 94.1288528, 2059.24487, 0.0922517404, 1.40339107e-09, -0.995735705, 8.31396285e-09, 1, 2.17966334e-09, 0.995735705, -8.47958681e-09, 0.0922517404),
- ["Telhado"] = CFrame.new(959.683105, 133.636993, 2267.60449, -0.908200383, 4.79157087e-08, 0.41853565, 6.11828739e-08, 1, 1.82794473e-08, -0.41853565, 4.22086153e-08, -0.908200383),
- ["Cafeteria"] = CFrame.new(907.480286, 99.9899521, 2253.39209, 0.992569506, 0, 0.121679187, 0, 1, 0, -0.121679187, 0, 0.992569506)
- }
- -- ================= OPTIMIZATION
- local optimizationStore = { lighting = {}, partsCastShadow = {}, emittersEnabled = {}, lightsSettings = {}, otherEffects = {} }
- local optimizationApplied = false
- local function applyOptimization(enable)
- if enable == optimizationApplied then return end
- if enable then
- pcall(function()
- optimizationStore.lighting.GlobalShadows = Lighting.GlobalShadows
- optimizationStore.lighting.Brightness = Lighting.Brightness
- optimizationStore.lighting.Ambient = Lighting.Ambient
- optimizationStore.lighting.OutdoorAmbient = Lighting.OutdoorAmbient
- optimizationStore.lighting.FogEnd = Lighting.FogEnd
- end)
- pcall(function()
- Lighting.GlobalShadows = false
- Lighting.Brightness = math.max(1, (optimizationStore.lighting.Brightness or 1))
- Lighting.Ambient = Color3.fromRGB(185,185,185)
- Lighting.OutdoorAmbient = Color3.fromRGB(170,170,170)
- Lighting.FogEnd = 1e6
- end)
- for _,inst in ipairs(Workspace:GetDescendants()) do
- if inst:IsA("BasePart") then optimizationStore.partsCastShadow[inst] = inst.CastShadow; pcall(function() inst.CastShadow = false end) end
- if inst:IsA("ParticleEmitter") or inst:IsA("Trail") or inst:IsA("Beam") or inst:IsA("Sparkles") or inst:IsA("Fire") or inst:IsA("Smoke") then optimizationStore.emittersEnabled[inst] = inst.Enabled; pcall(function() inst.Enabled = false end) end
- if inst:IsA("PointLight") or inst:IsA("SpotLight") or inst:IsA("SurfaceLight") then optimizationStore.lightsSettings[inst] = {Brightness = inst.Brightness, Range = inst.Range}; pcall(function() inst.Brightness = 0; inst.Range = 0 end) end
- end
- optimizationApplied = true
- else
- pcall(function()
- if optimizationStore.lighting.GlobalShadows ~= nil then Lighting.GlobalShadows = optimizationStore.lighting.GlobalShadows end
- if optimizationStore.lighting.Brightness ~= nil then Lighting.Brightness = optimizationStore.lighting.Brightness end
- if optimizationStore.lighting.Ambient ~= nil then Lighting.Ambient = optimizationStore.lighting.Ambient end
- if optimizationStore.lighting.OutdoorAmbient ~= nil then Lighting.OutdoorAmbient = optimizationStore.lighting.OutdoorAmbient end
- if optimizationStore.lighting.FogEnd ~= nil then Lighting.FogEnd = optimizationStore.lighting.FogEnd end
- end)
- for inst,prev in pairs(optimizationStore.partsCastShadow) do pcall(function() if inst and inst:IsA("BasePart") then inst.CastShadow = prev end end) end
- optimizationStore.partsCastShadow = {}
- for inst,prev in pairs(optimizationStore.emittersEnabled) do pcall(function() if inst and inst:IsA("ParticleEmitter") then inst.Enabled = prev end end) end
- optimizationStore.emittersEnabled = {}
- for inst,prev in pairs(optimizationStore.lightsSettings) do pcall(function() if inst and (inst:IsA("PointLight") or inst:IsA("SpotLight") or inst:IsA("SurfaceLight")) then inst.Brightness = prev.Brightness; inst.Range = prev.Range end end) end
- optimizationStore.lightsSettings = {}
- optimizationApplied = false
- end
- end
- -- ================= UTILITIES
- local function getHumanoid(char) return char and char:FindFirstChildOfClass("Humanoid") end
- local function inFront(pos) return Camera and Camera.CFrame and Camera.CFrame:PointToObjectSpace(pos).Z < 0 end
- local function getTargetPartFromChar(char)
- if not char then return nil end
- local head = char:FindFirstChild("Head")
- local torso = char:FindFirstChild("UpperTorso") or char:FindFirstChild("Torso")
- if Settings.TargetPart == "Head" then return head
- elseif Settings.TargetPart == "Torso" then return torso
- else
- if math.random() <= 0.6 then return head or torso else return torso or head end
- end
- end
- local function getWeaponOrigin()
- if LP.Character then
- local tool = LP.Character:FindFirstChildOfClass("Tool")
- if tool then
- local handle = tool:FindFirstChild("Handle") or tool:FindFirstChild("Muzzle") or tool:FindFirstChild("Barrel")
- if not handle then for _,v in ipairs(tool:GetChildren()) do if v:IsA("BasePart") then handle = v; break end end end
- if handle and handle:IsA("BasePart") then return handle.Position end
- end
- local hrp = LP.Character:FindFirstChild("HumanoidRootPart") or LP.Character:FindFirstChild("Torso") or LP.Character:FindFirstChild("Head")
- if hrp then return hrp.Position end
- end
- if Camera and Camera.CFrame then return Camera.CFrame.Position end
- return Vector3.new()
- end
- local function hasClearShot(part)
- if not part then return false end
- local origin = getWeaponOrigin()
- local params = RaycastParams.new()
- params.FilterType = Enum.RaycastFilterType.Blacklist
- params.FilterDescendantsInstances = {LP.Character}
- local dir = part.Position - origin
- local ok, r = pcall(function() return Workspace:Raycast(origin, dir, params) end)
- if ok and r and r.Instance and r.Instance:IsDescendantOf(part.Parent) then return true end
- return false
- end
- local function computeLateralOffset(targetPos, sideMultiplier)
- if not targetPos or not Camera then return Vector3.new() end
- local dist = (targetPos - Camera.CFrame.Position).Magnitude
- local base = SilentAimSettings.MISS_OFFSET_BASE
- local mag = math.clamp((dist/200) * base + 0.4, 0.4, base*2)
- local right = Camera.CFrame.RightVector
- local side = sideMultiplier or ((math.random() < 0.5) and -1 or 1)
- local up = Camera.CFrame.UpVector * (math.random(-30,30)/100)
- return (right * (side * mag)) + up
- end
- local function passesTeamFilter(p)
- if not p or not p.Team then
- if Settings.TeamFilterEnabled then
- local any=false
- for k,v in pairs(Settings.TeamFilter) do if v then any=true; break end end
- if any then return false end
- end
- return true
- end
- if not Settings.TeamFilterEnabled then
- if LP.Team and p.Team and LP.Team == p.Team then return false end
- return true
- end
- return Settings.TeamFilter[p.Team.Name] == true
- end
- local function isLikelyShoot(selfArg, args, method)
- if method == "Raycast" then return true end
- local nm = (typeof(selfArg) == "Instance" and (selfArg.Name or ""):lower()) or ""
- local keywords = {"shoot","fire","bullet","ray","projectile","replicate","weapon","fireweapon","shooting","firebullet","shootbullet"}
- for _,kw in ipairs(keywords) do if string.find(nm, kw) then return true end end
- for i=1,#args do
- local a = args[i]
- if typeof(a) == "Vector3" or typeof(a) == "CFrame" then return true end
- if type(a) == "table" and a.Position then return true end
- end
- return false
- end
- -- ================= TARGET SELECTION
- local function gatherCandidates()
- local out = {}
- if not Camera or not Camera.ViewportSize then return out end
- local center = Camera.ViewportSize/2
- local myRoot = LP.Character and LP.Character:FindFirstChild("HumanoidRootPart")
- if not myRoot then return out end
- for _,p in ipairs(Players:GetPlayers()) do
- if p ~= LP and getHumanoid(p.Character) and getHumanoid(p.Character).Health > 0 and passesTeamFilter(p) then
- local part = getTargetPartFromChar(p.Character)
- if part and inFront(part.Position) and hasClearShot(part) then
- local root = p.Character:FindFirstChild("HumanoidRootPart")
- if root then
- local d = (root.Position - myRoot.Position).Magnitude
- if d <= SilentAimSettings.MaxDistance then
- local v,on = Camera:WorldToViewportPoint(part.Position)
- if on then
- local sd = (Vector2.new(v.X, v.Y) - center).Magnitude
- if sd <= Settings.FOVRadius then
- table.insert(out, {player=p, part=part, sd=sd, dist=d, screenPos = Vector2.new(v.X, v.Y)})
- end
- end
- end
- end
- end
- end
- end
- return out
- end
- local function isCriminalTeam(p)
- if not p or not p.Team or not p.Team.Name then return false end
- local name = tostring(p.Team.Name):lower()
- return name:find("criminal") or name:find("crim") or name:find("bandit")
- end
- local function pickBest(cands)
- if not cands or #cands==0 then return nil end
- local center = Camera.ViewportSize/2
- local centerThreshold = math.max(8, math.floor(Settings.FOVRadius * 0.08))
- for _,c in ipairs(cands) do
- if (c.screenPos - center).Magnitude <= centerThreshold then return c end
- end
- table.sort(cands, function(a,b)
- local ac = isCriminalTeam(a.player) and 1 or 0
- local bc = isCriminalTeam(b.player) and 1 or 0
- if ac ~= bc then return ac > bc end
- local function hasTool(p)
- if not p.Character then return false end
- for _,c in ipairs(p.Character:GetChildren()) do if c:IsA("Tool") then return true end end
- local bp = p:FindFirstChildOfClass("Backpack")
- if bp then for _,c in ipairs(bp:GetChildren()) do if c:IsA("Tool") then return true end end end
- return false
- end
- local aTool = hasTool(a.player) and 1 or 0
- local bTool = hasTool(b.player) and 1 or 0
- if aTool ~= bTool then return aTool > bTool end
- if a.dist ~= b.dist then return a.dist < b.dist end
- return a.sd < b.sd
- end)
- return cands[1]
- end
- local function findBestTarget(precomputed)
- local sel = pickBest(precomputed)
- if currentPlayer and sel and sel.player ~= currentPlayer then
- if tick() - lastSwitch < SilentAimSettings.PERSISTENCE_TIME then
- return currentPlayer, currentTargetPart
- end
- end
- lastSwitch = tick()
- if sel then
- if currentPlayer ~= sel.player then
- targetEnterTime[sel.player] = tick()
- local jitter = ((math.random() - 0.5) * 2) * (Settings.DelayJitter or 0.15)
- local delayTime = math.max(0, (Settings.DelayMean or 0.35) + jitter)
- targetDeadline[sel.player] = tick() + delayTime
- deviationState[sel.player] = { idx = 0, side = (math.random()<0.5 and -1 or 1), lastFlip = tick() }
- end
- return sel.player, sel.part
- end
- return nil, nil
- end
- -- ================= ESP (robusto, substitui versão frágil)
- local espCache = {}
- local function safeDestroy(obj)
- pcall(function()
- if obj and obj.Destroy then obj:Destroy() end
- end)
- end
- local function removeDrawingLine(line)
- pcall(function()
- if line and line.Remove then
- line.Visible = false
- line:Remove()
- end
- end)
- end
- local function clearESPForPlayer(p)
- if not p then return end
- local s = espCache[p]
- if not s then return end
- pcall(function()
- if s.diedConn then pcall(function() s.diedConn:Disconnect() end) end
- if s.highlight and s.highlight.Parent then s.highlight:Destroy() end
- if s.nameGui and s.nameGui.Parent then s.nameGui:Destroy() end
- if s.hpGui and s.hpGui.Parent then s.hpGui:Destroy() end
- if s.line then removeDrawingLine(s.line) end
- end)
- espCache[p] = nil
- end
- local function ensureESPObjectsForPlayer(p)
- if not p then return end
- local obj = espCache[p]
- if not obj then obj = {}; espCache[p] = obj end
- -- Highlight
- pcall(function()
- local char = p.Character
- if char and char.Parent then
- local needNew = true
- if obj.highlight and obj.highlight.Parent == char then needNew = false else if obj.highlight then safeDestroy(obj.highlight); obj.highlight = nil end end
- if needNew then
- local ok, hl = pcall(function()
- local h = Instance.new("Highlight")
- h.Name = "DeltaESP"
- h.Parent = char
- h.FillTransparency = 0.6
- h.OutlineTransparency = 1
- return h
- end)
- if ok and hl then obj.highlight = hl end
- end
- else
- if obj.highlight then safeDestroy(obj.highlight); obj.highlight = nil end
- end
- end)
- -- Name GUI and HP GUI (attach to current Head)
- pcall(function()
- local char = p.Character
- local head = char and char:FindFirstChild("Head")
- -- Name
- if head and head.Parent then
- local needNew = true
- if obj.nameGui and obj.nameGui.Adornee == head and obj.nameGui.Parent == PlayerGui then needNew = false else if obj.nameGui then safeDestroy(obj.nameGui); obj.nameGui = nil; obj.nameLabel = nil end end
- if needNew then
- local ok, bg = pcall(function()
- local bg = Instance.new("BillboardGui")
- bg.Name = "DeltaNameGui"
- bg.Adornee = head
- bg.Size = UDim2.new(0,90,0,14)
- bg.StudsOffset = Vector3.new(0,2.2,0)
- bg.AlwaysOnTop = true
- bg.Parent = PlayerGui
- local lbl = Instance.new("TextLabel", bg)
- lbl.Size = UDim2.new(1,0,1,0); lbl.BackgroundTransparency = 1
- lbl.Text = p.Name; lbl.Font = Enum.Font.SourceSans; lbl.TextSize = 12
- lbl.TextColor3 = Color3.new(1,1,1)
- return bg
- end)
- if ok and bg then obj.nameGui = bg; obj.nameLabel = bg:FindFirstChildWhichIsA("TextLabel") end
- end
- else
- if obj.nameGui then safeDestroy(obj.nameGui); obj.nameGui = nil; obj.nameLabel = nil end
- end
- -- HP
- if head and head.Parent then
- local needNew = true
- if obj.hpGui and obj.hpGui.Adornee == head and obj.hpGui.Parent == PlayerGui then needNew = false else if obj.hpGui then safeDestroy(obj.hpGui); obj.hpGui = nil; obj.hpFill = nil end end
- if needNew then
- local ok, hp = pcall(function()
- local hp = Instance.new("BillboardGui")
- hp.Name = "DeltaHPGui"
- hp.Adornee = head
- hp.Size = UDim2.new(0,8,0,18)
- hp.StudsOffset = Vector3.new(1.25,1.6,0)
- hp.AlwaysOnTop = true
- local bgf = Instance.new("Frame", hp)
- bgf.Size = UDim2.new(1,0,1,0); bgf.BackgroundColor3 = Color3.fromRGB(200,200,200)
- local fill = Instance.new("Frame", bgf); fill.Name="Fill"; fill.AnchorPoint = Vector2.new(0,1); fill.Position = UDim2.new(0,0,1,0); fill.Size = UDim2.new(1,0,1,0); fill.BackgroundColor3 = Color3.fromRGB(0,220,0)
- hp.Parent = PlayerGui
- return hp
- end)
- if ok and hp then obj.hpGui = hp; obj.hpFill = obj.hpGui:FindFirstChildWhichIsA("Frame") and obj.hpGui:FindFirstChildWhichIsA("Frame"):FindFirstChild("Fill") end
- end
- else
- if obj.hpGui then safeDestroy(obj.hpGui); obj.hpGui = nil; obj.hpFill = nil end
- end
- end)
- -- Drawing line
- if HAS_DRAWING then
- pcall(function()
- if not obj.line or (obj.line and (not pcall(function() return obj.line and obj.line.From end))) then
- if obj.line then removeDrawingLine(obj.line); obj.line = nil end
- local ok, line = pcall(function() return Drawing.new("Line") end)
- if ok and line then line.Thickness = 1.8; line.Visible = false; obj.line = line end
- end
- end)
- else
- if obj.line then removeDrawingLine(obj.line); obj.line = nil end
- end
- -- died connection
- pcall(function()
- if obj.diedConn and obj.diedConn.Connected then return end
- if obj.diedConn then pcall(function() obj.diedConn:Disconnect() end) end
- local hum = p.Character and getHumanoid(p.Character)
- if hum then
- obj.diedConn = hum.Died:Connect(function()
- task.delay(1.5, function() clearESPForPlayer(p) end)
- end)
- end
- end)
- end
- local function updateESPForPlayer(p)
- if not p then return end
- if not Settings.ESP then clearESPForPlayer(p); return end
- -- Try a few times to attach GUIs (non-blocking)
- task.spawn(function()
- local tries = 0
- while tries < 8 do
- tries = tries + 1
- ensureESPObjectsForPlayer(p)
- local obj = espCache[p]
- if obj then
- pcall(function()
- if obj.highlight and obj.highlight.Parent then
- if p == currentPlayer then
- obj.highlight.FillColor = Color3.fromRGB(200,140,255)
- obj.highlight.FillTransparency = 0.08
- obj.highlight.Enabled = true
- else
- if p.Team and p.Team.Name == "Guards" then obj.highlight.FillColor = Color3.fromRGB(0,140,255)
- elseif p.Team and p.Team.Name == "Inmates" then obj.highlight.FillColor = Color3.fromRGB(255,140,0)
- else obj.highlight.FillColor = Color3.fromRGB(255,40,40) end
- obj.highlight.FillTransparency = 0.6
- obj.highlight.Enabled = true
- end
- end
- if obj.nameGui and obj.nameLabel then
- if Settings.ESP_Name and p.Character and p.Character:FindFirstChild("Head") then
- if not obj.nameGui.Parent then obj.nameGui.Parent = PlayerGui end
- obj.nameLabel.Text = p.Name
- obj.nameLabel.TextColor3 = Color3.new(1,1,1)
- else
- if obj.nameGui and obj.nameGui.Parent then obj.nameGui.Parent = nil end
- end
- end
- local hum = p.Character and getHumanoid(p.Character)
- if obj.hpGui and obj.hpFill then
- if Settings.ESP_Health and hum then
- local pct = math.clamp((hum.Health or 0)/(hum.MaxHealth or 100), 0, 1)
- obj.hpFill.Size = UDim2.new(1,0,pct,0)
- if not obj.hpGui.Parent then obj.hpGui.Parent = PlayerGui end
- else
- if obj.hpGui and obj.hpGui.Parent then obj.hpGui.Parent = nil end
- end
- end
- if obj.line and HAS_DRAWING and Settings.ESP_Line and p.Character then
- local targetPart = getTargetPartFromChar(p.Character) or p.Character:FindFirstChild("HumanoidRootPart") or p.Character:FindFirstChild("Head")
- if targetPart then
- local v,on = Camera:WorldToViewportPoint(targetPart.Position)
- if on then
- obj.line.Visible = true
- obj.line.From = Camera.ViewportSize/2
- obj.line.To = Vector2.new(v.X, v.Y)
- if p == currentPlayer then obj.line.Color = Color3.fromRGB(200,140,255)
- else
- if p.Team and p.Team.Name == "Guards" then obj.line.Color = Color3.fromRGB(0,140,255)
- elseif p.Team and p.Team.Name == "Inmates" then obj.line.Color = Color3.fromRGB(255,140,0)
- else obj.line.Color = Color3.fromRGB(255,40,40) end
- end
- else
- obj.line.Visible = false
- end
- else
- obj.line.Visible = false
- end
- elseif obj.line then obj.line.Visible = false end
- end)
- end
- -- break early if successfully attached to character head/highlight
- local okAttached = false
- local o = espCache[p]
- if o then
- if (o.highlight and o.highlight.Parent == (p.Character or nil)) then okAttached = true end
- if (o.nameGui and o.nameGui.Adornee == (p.Character and p.Character:FindFirstChild("Head"))) then okAttached = true end
- if (o.hpGui and o.hpGui.Adornee == (p.Character and p.Character:FindFirstChild("Head"))) then okAttached = true end
- end
- if okAttached then break end
- task.wait(0.08)
- end
- end)
- end
- -- Hook up player events for ESP
- for _,p in ipairs(Players:GetPlayers()) do
- p.CharacterAdded:Connect(function() task.delay(0.06, function() if Settings.ESP then updateESPForPlayer(p) end end) end)
- p.CharacterRemoving:Connect(function() clearESPForPlayer(p) end)
- end
- Players.PlayerAdded:Connect(function(p) p.CharacterAdded:Connect(function() task.delay(0.06, function() if Settings.ESP then updateESPForPlayer(p) end end) end); p.CharacterRemoving:Connect(function() clearESPForPlayer(p) end) end)
- Players.PlayerRemoving:Connect(function(p) clearESPForPlayer(p) end)
- -- ================= Miss probability helpers
- local function registerShot()
- table.insert(recentShots, tick())
- while #recentShots > 0 and recentShots[1] < tick() - (Settings.ErrarShotWindow or 1.2) do table.remove(recentShots,1) end
- end
- local function updateCameraMovement(dt)
- if not lastCameraCFrame then lastCameraCFrame = Camera.CFrame; return end
- local a1 = lastCameraCFrame.LookVector
- local a2 = Camera.CFrame.LookVector
- local dot = math.clamp(a1:Dot(a2), -1, 1)
- local ang = math.acos(dot)
- local speed = ang / math.max(dt, 1/120)
- camAngularSpeed = camAngularSpeed * 0.8 + speed * 0.2
- lastCameraCFrame = Camera.CFrame
- end
- local function getVelocityMagnitudeForPlayer(pl)
- if not pl or not pl.Character then return 0 end
- local hrp = pl.Character:FindFirstChild("HumanoidRootPart")
- if not hrp then return 0 end
- return hrp.Velocity and hrp.Velocity.Magnitude or 0
- end
- local function computeMissProbability(targetPlayer)
- if not targetPlayer then return 0 end
- local base = Settings.ErrarBase or 0.26
- local maxv = Settings.ErrarMax or 0.45
- local jitter = Settings.ErrarJitter or 0.07
- local myRoot = LP.Character and LP.Character:FindFirstChild("HumanoidRootPart")
- local distNorm = 0
- if myRoot and targetPlayer.Character and targetPlayer.Character:FindFirstChild("HumanoidRootPart") then
- local d = (targetPlayer.Character.HumanoidRootPart.Position - myRoot.Position).Magnitude
- distNorm = math.clamp(d / (SilentAimSettings.MaxDistance or 600), 0, 1)
- end
- local targetVel = getVelocityMagnitudeForPlayer(targetPlayer) / 20
- local localVel = getVelocityMagnitudeForPlayer(LP) / 20
- targetVel = math.clamp(targetVel, 0, 1)
- localVel = math.clamp(localVel, 0, 1)
- local cam = math.clamp(camAngularSpeed / 2.5, 0, 1)
- local streak = math.clamp(#recentShots / 8, 0, 1)
- local p = base
- p = p + distNorm * (Settings.ErrarDistWeight or 0.12)
- p = p + targetVel * (Settings.ErrarTargetMoveWeight or 0.18)
- p = p + localVel * (Settings.ErrarLocalMoveWeight or 0.12)
- p = p + cam * (Settings.ErrarCamMoveWeight or 0.12)
- p = p + streak * (Settings.ErrarShotStreakWeight or 0.05)
- local j = ((math.random()-0.5) * 2) * jitter
- p = p + j
- local last = perTargetProb[targetPlayer] or p
- local smooth = last * 0.7 + p * 0.3
- perTargetProb[targetPlayer] = smooth
- return math.clamp(smooth, 0.01, maxv)
- end
- -- ================= NAMECALL HOOK (kept)
- local namecall_old = nil
- if CAN_HOOK then
- local ok, mt = pcall(function() return getrawmetatable(game) end)
- if ok and mt then
- pcall(function() setreadonly(mt,false) end)
- namecall_old = mt.__namecall
- mt.__namecall = newcclosure(function(self,...)
- local args={...}
- local method = getnamecallmethod and getnamecallmethod() or ""
- if method == "Raycast" or method == "FireServer" or method == "InvokeServer" then
- recentShots[#recentShots+1] = tick()
- end
- if Settings.SilentAim and currentTargetPart and currentPlayer then
- if Settings.DelayFarTargets then
- local deadline = targetDeadline[currentPlayer] or (targetEnterTime[currentPlayer] or 0) + (Settings.DelayMean or 0.35)
- if tick() < deadline then return namecall_old(self, ...) end
- end
- local shouldRedirect = false
- local offset = Vector3.new()
- local hitChance = (Settings.TargetPart == "Random") and 0.95 or 0.78
- if math.random() <= hitChance then shouldRedirect = true end
- if Settings.ErrarTiros and cachedMissTarget and cachedMissTarget == currentPlayer then
- if math.random() < (cachedMissProb or 0) then
- shouldRedirect = true
- local st = deviationState[currentPlayer] or { idx = 0, side = (math.random()<0.5 and -1 or 1), lastFlip = tick() }
- st.idx = (st.idx or 0) + 1
- if tick() - (st.lastFlip or 0) > (0.12 + math.random()*0.28) then st.side = -st.side; st.lastFlip = tick() end
- deviationState[currentPlayer] = st
- offset = computeLateralOffset(currentTargetPart.Position, st.side)
- end
- end
- if method == "Raycast" then
- local origin = args[1] or Camera.CFrame.Position
- local originPos = origin
- if typeof(origin) == "CFrame" then originPos = origin.Position end
- if typeof(originPos) == "Vector3" and shouldRedirect and currentTargetPart then
- args[2] = (currentTargetPart.Position + offset) - originPos
- end
- return namecall_old(self, unpack(args))
- end
- if (method == "FireServer" or method == "InvokeServer") then
- local remoteName = (typeof(self) == "Instance" and self.Name) or ""
- local n = string.lower(remoteName)
- local blacklist = {"arrest","cuff","handcuff","detain","taser","stun","punch","melee"}
- for _,sub in ipairs(blacklist) do if string.find(n, sub) then return namecall_old(self, ...) end end
- if shouldRedirect and currentTargetPart then
- for i=1,#args do
- local a = args[i]
- if typeof(a) == "Vector3" then args[i] = currentTargetPart.Position + offset
- elseif typeof(a) == "CFrame" then args[i] = CFrame.new(currentTargetPart.Position + offset)
- elseif type(a) == "table" and a.Position then args[i] = { Position = currentTargetPart.Position + offset } end
- end
- end
- return namecall_old(self, unpack(args))
- end
- end
- return namecall_old(self, ...)
- end)
- pcall(function() setreadonly(mt,true) end)
- end
- end
- -- ================= SAFE TELEPORT HELPERS
- local function reattachCamera()
- pcall(function()
- local hum = LP.Character and LP.Character:FindFirstChildOfClass("Humanoid")
- if hum then Camera.CameraSubject = hum; Camera.CameraType = Enum.CameraType.Custom end
- end)
- end
- local TELEPORT_THROTTLE = 0.6
- local _lastTeleport = 0
- local function isSafeGroundAt(cframe)
- local origin = cframe.Position + Vector3.new(0, 30, 0)
- local params = RaycastParams.new()
- params.FilterType = Enum.RaycastFilterType.Blacklist
- params.FilterDescendantsInstances = {LP.Character}
- local r = Workspace:Raycast(origin, Vector3.new(0,-60,0), params)
- return r
- end
- local function safeTeleportTo(cframeTarget)
- if not LP.Character or not LP.Character:FindFirstChild("HumanoidRootPart") then return false end
- if tick() - _lastTeleport < TELEPORT_THROTTLE then return false end
- _lastTeleport = tick()
- local hrp = LP.Character.HumanoidRootPart
- local finalCFrame = cframeTarget
- for i=1,6 do
- local ok = isSafeGroundAt(finalCFrame)
- if ok then break end
- finalCFrame = finalCFrame + Vector3.new(0,1.2,0)
- task.wait(0.01)
- end
- local ok, err = pcall(function()
- hrp.CFrame = finalCFrame
- task.wait(0.03)
- pcall(reattachCamera)
- end)
- if not ok then warn("safeTeleportTo failed:", err); return false end
- return true
- end
- -- ================= WEAPON PICK helpers (TREMER até pegar)
- local function hasToolNamed(name)
- local lname = tostring(name):lower()
- if LP.Character then for _,c in ipairs(LP.Character:GetChildren()) do if c:IsA("Tool") and string.find((c.Name or ""):lower(), lname,1,true) then return true end end end
- local bp = LP:FindFirstChildOfClass("Backpack")
- if bp then for _,c in ipairs(bp:GetChildren()) do if c:IsA("Tool") and string.find((c.Name or ""):lower(), lname,1,true) then return true end end end
- return false
- end
- local function waitForPickup(weaponName, timeout)
- local deadline = tick() + (timeout or 4)
- if hasToolNamed(weaponName) then return true end
- local picked=false; local conns={}
- if LP.Character then table.insert(conns, LP.Character.ChildAdded:Connect(function(child) if child and child:IsA("Tool") and string.find((child.Name or ""):lower(), weaponName:lower(),1,true) then picked=true end end)) end
- local bp = LP:FindFirstChildOfClass("Backpack")
- if bp then table.insert(conns, bp.ChildAdded:Connect(function(child) if child and child:IsA("Tool") and string.find((child.Name or ""):lower(), weaponName:lower(),1,true) then picked=true end end)) end
- while not picked and tick() < deadline do
- if hasToolNamed(weaponName) then picked=true; break end
- task.wait(0.08)
- end
- for _,c in ipairs(conns) do pcall(function() c:Disconnect() end) end
- return picked
- end
- local function instantTeleportPick(list)
- if not LP.Character or not LP.Character:FindFirstChild("HumanoidRootPart") then return end
- local hrp = LP.Character.HumanoidRootPart
- local origin = hrp.CFrame
- local autoWas = Settings.AutoPickWeapons
- Settings.AutoPickWeapons = false
- for _,w in ipairs(list) do
- if not hasToolNamed(w) then
- local cf = TELEPORT_CFRAMES[w]
- if cf then
- safeTeleportTo(cf)
- local deadline = tick() + 2.0
- while tick() < deadline and not hasToolNamed(w) do
- local shakeX = (math.random() - 0.5) * 0.12
- local shakeZ = (math.random() - 0.5) * 0.12
- local shakeY = (math.random() - 0.5) * 0.02
- pcall(function()
- if hrp and hrp.Parent then hrp.CFrame = cf * CFrame.new(shakeX, shakeY, shakeZ) end
- end)
- task.wait(0.06)
- end
- if not hasToolNamed(w) then
- pcall(function()
- if hrp and hrp.Parent then
- local forward = cf.LookVector * 0.6
- hrp.CFrame = CFrame.new(cf.Position + forward, cf.Position + forward + cf.LookVector)
- end
- end)
- task.wait(0.25)
- end
- if not hasToolNamed(w) then
- local picked = waitForPickup(w, 0.9)
- if not picked then end
- end
- end
- task.wait(0.06)
- end
- end
- pcall(function()
- if LP.Character and LP.Character:FindFirstChild("HumanoidRootPart") then LP.Character.HumanoidRootPart.CFrame = origin end
- end)
- task.delay(0.05, reattachCamera)
- Settings.AutoPickWeapons = autoWas
- end
- -- Auto-pick worker
- task.spawn(function()
- while true do
- if Settings.AutoPickWeapons then
- local sel = {}
- for name,ok in pairs(Settings.Mods_Weapons) do if ok then table.insert(sel, name) end end
- if #sel > 0 and LP.Character and LP.Character:FindFirstChild("HumanoidRootPart") then
- instantTeleportPick(sel)
- task.wait(1.2)
- else
- task.wait(0.9)
- end
- else task.wait(0.9) end
- end
- end)
- -- ================= UI (menu) ===========================================
- pcall(function() local old = PlayerGui:FindFirstChild("delta_final_ui"); if old then old:Destroy() end end)
- local gui = Instance.new("ScreenGui")
- gui.Name = "delta_final_ui"
- gui.ResetOnSpawn = false
- gui.Parent = PlayerGui
- gui.ZIndexBehavior = Enum.ZIndexBehavior.Sibling
- gui.Enabled = true
- local openBtn = Instance.new("TextButton", gui)
- openBtn.Size = UDim2.new(0,26,0,26)
- openBtn.Position = UDim2.new(0,8,0.5,-13)
- openBtn.Text = "≡"
- openBtn.TextSize = 18
- openBtn.BackgroundColor3 = Color3.fromRGB(28,28,28)
- openBtn.TextColor3 = Color3.new(1,1,1)
- Instance.new("UICorner", openBtn)
- local menu = Instance.new("Frame", gui)
- menu.Size = UDim2.new(0,320,0,420)
- menu.Position = UDim2.new(0.5,-160,0.5,-210)
- menu.BackgroundColor3 = Color3.fromRGB(34,34,34)
- menu.Visible = false
- Instance.new("UICorner", menu)
- local header = Instance.new("Frame", menu); header.Size = UDim2.new(1,0,0,36); header.BackgroundTransparency = 1
- local title = Instance.new("TextLabel", header); title.Size = UDim2.new(1,-60,1,0); title.Position = UDim2.new(0,10,0,0); title.BackgroundTransparency = 1; title.Text="Delta Mobile — FINAL"; title.TextColor3 = Color3.new(1,1,1); title.Font=Enum.Font.SourceSansBold; title.TextSize=16; title.TextXAlignment = Enum.TextXAlignment.Left
- local closeBtn = Instance.new("TextButton", header); closeBtn.Size = UDim2.new(0,18,0,18); closeBtn.Position = UDim2.new(1,-40,0,8); closeBtn.Text="✕"; closeBtn.BackgroundColor3 = Color3.fromRGB(45,45,45); closeBtn.TextColor3 = Color3.new(1,1,1); Instance.new("UICorner", closeBtn)
- local content = Instance.new("Frame", menu); content.Position = UDim2.new(0,8,0,42); content.Size = UDim2.new(1,-16,1,-58); content.BackgroundTransparency = 1
- local function makeTab(name, pos)
- local b = Instance.new("TextButton", content)
- b.Size = UDim2.new(0.24,-6,0,26)
- b.Position = UDim2.new(pos,0,0,4)
- b.Text = name
- b.BackgroundColor3 = Color3.fromRGB(45,45,45)
- b.TextColor3 = Color3.new(1,1,1)
- b.TextSize = 13
- Instance.new("UICorner", b)
- return b
- end
- local tabAim = makeTab("Aim", 0.01)
- local tabESP = makeTab("ESP", 0.26)
- local tabMods = makeTab("Mods", 0.51)
- local tabConfig = makeTab("Config", 0.76)
- local function makeScrollPanel()
- local s = Instance.new("ScrollingFrame", content)
- s.Size = UDim2.new(1,0,1,-40)
- s.Position = UDim2.new(0,0,0,40)
- s.BackgroundTransparency = 1
- s.ScrollBarThickness = 8
- s.AutomaticCanvasSize = Enum.AutomaticSize.Y
- local layout = Instance.new("UIListLayout", s)
- layout.SortOrder = Enum.SortOrder.LayoutOrder
- layout.Padding = UDim.new(0,8)
- return s
- end
- local aimPanel = makeScrollPanel()
- local espPanel = makeScrollPanel()
- local modsPanel = makeScrollPanel()
- local configPanel = makeScrollPanel()
- aimPanel.Visible = true; espPanel.Visible = false; modsPanel.Visible = false; configPanel.Visible = false
- local function showPanel(p) aimPanel.Visible=false; espPanel.Visible=false; modsPanel.Visible=false; configPanel.Visible=false; p.Visible = true; p:BringToFront() end
- tabAim.MouseButton1Click:Connect(function() showPanel(aimPanel) end)
- tabESP.MouseButton1Click:Connect(function() showPanel(espPanel) end)
- tabMods.MouseButton1Click:Connect(function() showPanel(modsPanel) end)
- tabConfig.MouseButton1Click:Connect(function() showPanel(configPanel) end)
- openBtn.MouseButton1Click:Connect(function() menu.Visible = not menu.Visible end)
- closeBtn.MouseButton1Click:Connect(function() menu.Visible = false end)
- local function createToggle(parent, label, key)
- local b = Instance.new("TextButton", parent)
- b.Size = UDim2.new(0.96,0,0,30)
- b.BackgroundColor3 = Color3.fromRGB(45,45,45)
- b.TextColor3 = Color3.new(1,1,1)
- b.Text = label.." : "..(Settings[key] and "ON" or "OFF")
- b.TextXAlignment = Enum.TextXAlignment.Left
- b.Font = Enum.Font.SourceSans
- b.TextSize = 13
- Instance.new("UICorner", b)
- b.MouseButton1Click:Connect(function()
- Settings[key] = not Settings[key]
- b.Text = label.." : "..(Settings[key] and "ON" or "OFF")
- if key == "ShowFOV" then
- if fovCircle then fovCircle.Visible = Settings.ShowFOV end
- if fovGui then fovGui.Visible = Settings.ShowFOV end
- elseif key == "ESP" then
- if Settings.ESP then
- for _,pl in ipairs(Players:GetPlayers()) do task.spawn(function() updateESPForPlayer(pl) end) end
- else
- for _,pl in ipairs(Players:GetPlayers()) do clearESPForPlayer(pl) end
- end
- end
- end)
- return b
- end
- local function addCollapsible(parent, titleText, contentHeight, defaultOpen)
- local hdr = Instance.new("TextButton", parent)
- hdr.Size = UDim2.new(0.96,0,0,28)
- hdr.BackgroundColor3 = Color3.fromRGB(55,55,55)
- hdr.Text = (defaultOpen and "▼ " or "► ") .. titleText
- hdr.TextColor3 = Color3.new(1,1,1)
- hdr.TextXAlignment = Enum.TextXAlignment.Left
- Instance.new("UICorner", hdr)
- local container = Instance.new("Frame", parent)
- container.Size = UDim2.new(0.96,0,0, (defaultOpen and contentHeight or 0))
- container.Position = UDim2.new(0,0,0,30)
- container.BackgroundColor3 = Color3.fromRGB(40,40,40)
- container.ClipsDescendants = true
- Instance.new("UICorner", container)
- hdr.MouseButton1Click:Connect(function()
- local open = container.Size.Y.Offset > 0
- if open then hdr.Text = "► " .. titleText; TweenService:Create(container, TweenInfo.new(0.18, Enum.EasingStyle.Quad), {Size = UDim2.new(0.96,0,0,0)}):Play()
- else hdr.Text = "▼ " .. titleText; TweenService:Create(container, TweenInfo.new(0.18, Enum.EasingStyle.Quad), {Size = UDim2.new(0.96,0,0,contentHeight)}):Play() end
- end)
- return hdr, container
- end
- -- Build Aim panel
- do
- createToggle(aimPanel, "Silent Aim", "SilentAim")
- createToggle(aimPanel, "Errar Tiros (lateral)", "ErrarTiros")
- createToggle(aimPanel, "Delay p/ alvos (humanizado)", "DelayFarTargets")
- local tfHdr, tfCont = addCollapsible(aimPanel, "Team Filter (abrir/fechar)", 120, false)
- local tfLabel = Instance.new("TextLabel", tfCont); tfLabel.Size = UDim2.new(1,0,0,18); tfLabel.BackgroundTransparency = 1; tfLabel.Text = "Marque equipes para incluir"; tfLabel.TextColor3 = Color3.new(1,1,1)
- for i,tm in ipairs({"Guards","Inmates","Criminals"}) do
- local b = Instance.new("TextButton", tfCont)
- b.Size = UDim2.new(0.96,0,0,28)
- b.Position = UDim2.new(0,0,0,22 + (i-1)*30)
- b.Text = (Settings.TeamFilter[tm] and "☑ " or "☐ ")..tm
- b.BackgroundColor3 = Color3.fromRGB(45,45,45)
- b.TextColor3 = Color3.new(1,1,1)
- Instance.new("UICorner", b)
- b.MouseButton1Click:Connect(function()
- Settings.TeamFilter[tm] = not Settings.TeamFilter[tm]
- b.Text = (Settings.TeamFilter[tm] and "☑ " or "☐ ")..tm
- Settings.TeamFilterEnabled = (Settings.TeamFilter.Guards or Settings.TeamFilter.Inmates or Settings.TeamFilter.Criminals)
- end)
- end
- createToggle(aimPanel, "Show FOV", "ShowFOV")
- local fovRow = Instance.new("Frame", aimPanel); fovRow.Size = UDim2.new(0.96,0,0,50); fovRow.BackgroundTransparency = 1
- local fovLabel = Instance.new("TextLabel", fovRow); fovLabel.Size = UDim2.new(1,0,0,18); fovLabel.BackgroundTransparency = 1; fovLabel.Text = "FOV: "..Settings.FOVRadius; fovLabel.TextColor3 = Color3.new(1,1,1)
- local fovBar = Instance.new("Frame", fovRow); fovBar.Size = UDim2.new(1,0,0,12); fovBar.Position = UDim2.new(0,0,0,22); fovBar.BackgroundColor3 = Color3.fromRGB(45,45,45); Instance.new("UICorner", fovBar)
- local fovFill = Instance.new("Frame", fovBar); fovFill.Size = UDim2.new(Settings.FOVRadius/500,0,1,0); fovFill.BackgroundColor3 = Color3.fromRGB(255,255,255); Instance.new("UICorner", fovFill)
- local dragFOV=false
- fovBar.InputBegan:Connect(function(i) if i.UserInputType==Enum.UserInputType.MouseButton1 or i.UserInputType==Enum.UserInputType.Touch then dragFOV=true end end)
- fovBar.InputEnded:Connect(function(i) if i.UserInputType==Enum.UserInputType.MouseButton1 or i.UserInputType==Enum.UserInputType.Touch then dragFOV=false end end)
- UserInputService.InputChanged:Connect(function(i)
- if dragFOV and (i.UserInputType==Enum.UserInputType.MouseMovement or i.UserInputType==Enum.UserInputType.Touch) then
- local left = fovBar.AbsolutePosition.X; local abs = fovBar.AbsoluteSize.X
- local x = math.clamp(i.Position.X - left, 0, abs); local ratio = x/abs
- Settings.FOVRadius = math.floor(10 + ratio * 490)
- fovFill.Size = UDim2.new(Settings.FOVRadius/500,0,1,0)
- fovLabel.Text = "FOV: "..Settings.FOVRadius
- if fovCircle then fovCircle.Radius = Settings.FOVRadius end
- if fovGui then fovGui.Size = UDim2.new(0, Settings.FOVRadius*2, 0, Settings.FOVRadius*2); fovGui.Position = UDim2.new(0.5, -Settings.FOVRadius, 0.5, -Settings.FOVRadius) end
- end
- end)
- local partLabel = Instance.new("TextLabel", aimPanel); partLabel.Size = UDim2.new(0.96,0,0,18); partLabel.BackgroundTransparency = 1; partLabel.Text="Target Part: "..Settings.TargetPart; partLabel.TextColor3 = Color3.new(1,1,1)
- local partRow = Instance.new("Frame", aimPanel); partRow.Size = UDim2.new(0.96,0,0,34)
- local btnH = Instance.new("TextButton", partRow); btnH.Size = UDim2.new(0.30,0,1,0); btnH.Text="Head"; btnH.BackgroundColor3 = Color3.fromRGB(45,45,45); btnH.TextColor3=Color3.new(1,1,1)
- local btnT = Instance.new("TextButton", partRow); btnT.Size = UDim2.new(0.30,0,1,0); btnT.Position = UDim2.new(0.34,0,0,0); btnT.Text="Torso"; btnT.BackgroundColor3=Color3.fromRGB(45,45,45); btnT.TextColor3=Color3.new(1,1,1)
- local btnR = Instance.new("TextButton", partRow); btnR.Size = UDim2.new(0.30,0,1,0); btnR.Position = UDim2.new(0.66,0,0,0); btnR.Text="Random"; btnR.BackgroundColor3=Color3.fromRGB(45,45,45); btnR.TextColor3=Color3.new(1,1,1)
- btnH.MouseButton1Click:Connect(function() Settings.TargetPart="Head"; partLabel.Text="Target Part: Head" end)
- btnT.MouseButton1Click:Connect(function() Settings.TargetPart="Torso"; partLabel.Text="Target Part: Torso" end)
- btnR.MouseButton1Click:Connect(function() Settings.TargetPart="Random"; partLabel.Text="Target Part: Random" end)
- end
- -- ESP panel
- do
- createToggle(espPanel, "ESP Master", "ESP")
- createToggle(espPanel, "ESP Nome", "ESP_Name")
- createToggle(espPanel, "ESP Vida", "ESP_Health")
- createToggle(espPanel, "ESP Linha", "ESP_Line")
- end
- -- Mods panel (teleports, picks)
- do
- local tpHdr, tpCont = addCollapsible(modsPanel, "Teleports (abrir/fechar)", 120, false)
- local tpNames = {"Criminal Base","Telhado","Cafeteria"}
- local tpButtons = {}
- local selectedTp = nil
- for i,name in ipairs(tpNames) do
- local b = Instance.new("TextButton", tpCont)
- b.Size = UDim2.new(0.94,0,0,26); b.Position = UDim2.new(0.03,0,0,(i-1)*30 + 6)
- b.Text = name; b.BackgroundColor3 = Color3.fromRGB(60,60,60); b.TextColor3 = Color3.new(1,1,1)
- Instance.new("UICorner", b)
- b.MouseButton1Click:Connect(function()
- selectedTp = name
- for k,v in pairs(tpButtons) do if v then v.BackgroundColor3 = (k==name and Color3.fromRGB(120,160,240) or Color3.fromRGB(60,60,60)) end end
- end)
- tpButtons[name] = b
- end
- local tpBtn = Instance.new("TextButton", modsPanel)
- tpBtn.Size = UDim2.new(0.96,0,0,30)
- tpBtn.Text = "Teleportar para local selecionado"
- tpBtn.BackgroundColor3 = Color3.fromRGB(45,45,45)
- tpBtn.TextColor3 = Color3.new(1,1,1)
- Instance.new("UICorner", tpBtn)
- tpBtn.MouseButton1Click:Connect(function()
- if not selectedTp then return end
- local cf = LOCATION_CFRAMES[selectedTp]
- if not cf then return end
- task.spawn(function() safeTeleportTo(cf) end)
- end)
- local weaponsHdr, weaponsCont = addCollapsible(modsPanel, "Armas (abrir/fechar)", 160, false)
- local order = {"MP5","REMINGTON","M4A1","FAL","AK-47"}
- for i,name in ipairs(order) do
- local b = Instance.new("TextButton", weaponsCont)
- b.Size = UDim2.new(0.94,0,0,28)
- b.Position = UDim2.new(0.03,0,0,(i-1)*32 + 6)
- b.Text = (Settings.Mods_Weapons[name] and "☑ " or "☐ ")..name
- b.BackgroundColor3 = Color3.fromRGB(45,45,45)
- b.TextColor3 = Color3.new(1,1,1)
- Instance.new("UICorner", b)
- b.MouseButton1Click:Connect(function()
- Settings.Mods_Weapons[name] = not Settings.Mods_Weapons[name]
- b.Text = (Settings.Mods_Weapons[name] and "☑ " or "☐ ")..name
- end)
- end
- local pickBtn = Instance.new("TextButton", modsPanel)
- pickBtn.Size = UDim2.new(0.96,0,0,30)
- pickBtn.Text = "Pegar Armas (Manual - Teleport)"
- pickBtn.BackgroundColor3 = Color3.fromRGB(45,45,45)
- pickBtn.TextColor3 = Color3.new(1,1,1)
- Instance.new("UICorner", pickBtn)
- pickBtn.MouseButton1Click:Connect(function()
- task.spawn(function()
- local sel = {}
- for name,ok in pairs(Settings.Mods_Weapons) do if ok then table.insert(sel, name) end end
- if #sel == 0 then return end
- instantTeleportPick(sel)
- end)
- end)
- local autoBtn = Instance.new("TextButton", modsPanel)
- autoBtn.Size = UDim2.new(0.22,0,0,22)
- autoBtn.Text = "Auto"
- autoBtn.BackgroundColor3 = Color3.fromRGB(45,45,45)
- autoBtn.TextColor3 = Color3.new(1,1,1)
- Instance.new("UICorner", autoBtn)
- autoBtn.MouseButton1Click:Connect(function() Settings.AutoPickWeapons = not Settings.AutoPickWeapons; autoBtn.BackgroundColor3 = Settings.AutoPickWeapons and Color3.fromRGB(120,160,240) or Color3.fromRGB(45,45,45) end)
- end
- -- Config panel (kept simple)
- do
- local rejoinBtn = Instance.new("TextButton", configPanel)
- rejoinBtn.Size = UDim2.new(0.96,0,0,30)
- rejoinBtn.Position = UDim2.new(0.02,0,0,8)
- rejoinBtn.Text = "Rejoin (mesmo place)"
- rejoinBtn.BackgroundColor3 = Color3.fromRGB(45,45,45)
- rejoinBtn.TextColor3 = Color3.new(1,1,1)
- Instance.new("UICorner", rejoinBtn)
- rejoinBtn.MouseButton1Click:Connect(function() pcall(function() TeleportService:Teleport(game.PlaceId, LP) end) end)
- local optBtn = Instance.new("TextButton", configPanel)
- optBtn.Size = UDim2.new(0.96,0,0,30)
- optBtn.Position = UDim2.new(0.02,0,0,48)
- optBtn.Text = "Otimização : "..(Settings.Optimization and "ON" or "OFF")
- optBtn.BackgroundColor3 = Color3.fromRGB(45,45,45)
- optBtn.TextColor3 = Color3.new(1,1,1)
- Instance.new("UICorner", optBtn)
- optBtn.MouseButton1Click:Connect(function()
- Settings.Optimization = not Settings.Optimization
- optBtn.Text = "Otimização : "..(Settings.Optimization and "ON" or "OFF")
- pcall(function() applyOptimization(Settings.Optimization) end)
- end)
- -- Saved configs simplified (kept reading/writing minimal)
- local CONFIG_FILENAME = "delta_mobile_configs.json"
- local AUTOLOAD_FILENAME = "delta_mobile_autoload.json"
- local savedConfigs = {}
- if HAS_FILE then
- pcall(function()
- if isfile(CONFIG_FILENAME) then
- local raw = readfile(CONFIG_FILENAME)
- local ok, t = pcall(function() return HttpService:JSONDecode(raw) end)
- if ok and type(t)=="table" then savedConfigs = t end
- end
- end)
- end
- local cfgHdr, cfgCont = addCollapsible(configPanel, "Configs salvas (abrir/fechar)", 160, false)
- local listBox = Instance.new("ScrollingFrame", cfgCont); listBox.Size = UDim2.new(1,0,1,0); listBox.BackgroundTransparency = 1; listBox.AutomaticCanvasSize = Enum.AutomaticSize.Y; listBox.ScrollBarThickness = 8
- local layout = Instance.new("UIListLayout", listBox); layout.Padding = UDim.new(0,6)
- local selectedCfg = nil
- local btnMap = {}
- local function applyConfig(conf)
- if not conf then return end
- for k,v in pairs(conf.Settings or {}) do Settings[k] = v end
- for k,v in pairs(conf.Mods_Weapons or {}) do Settings.Mods_Weapons[k] = v end
- for k,v in pairs(conf.TeamFilter or {}) do Settings.TeamFilter[k] = v end
- end
- local function rebuildCfgList()
- for _,c in ipairs(listBox:GetChildren()) do if c:IsA("TextButton") then c:Destroy() end end
- local names = {}
- for n,_ in pairs(savedConfigs) do table.insert(names,n) end
- table.sort(names)
- for i,n in ipairs(names) do
- local b = Instance.new("TextButton", listBox)
- b.Size = UDim2.new(0.94,0,0,26)
- b.Position = UDim2.new(0.03,0,0,(i-1)*30 + 6)
- b.Text = n
- b.BackgroundColor3 = Color3.fromRGB(60,60,60)
- b.TextColor3 = Color3.new(1,1,1)
- b.TextXAlignment = Enum.TextXAlignment.Left
- Instance.new("UICorner", b)
- b.MouseButton1Click:Connect(function()
- selectedCfg = n
- for k,v in pairs(btnMap) do if v then v.BackgroundColor3 = (k==n and Color3.fromRGB(120,160,240) or Color3.fromRGB(60,60,60)) end end
- if Settings.AutoLoadConfigs then applyConfig(savedConfigs[n]) end
- end)
- btnMap[n] = b
- end
- end
- rebuildCfgList()
- local saveBox = Instance.new("TextBox", configPanel); saveBox.Size = UDim2.new(0.96,0,0,28); saveBox.Position = UDim2.new(0.02,0,0, 8 + 36 + 8); saveBox.BackgroundColor3 = Color3.fromRGB(50,50,50); saveBox.TextColor3 = Color3.new(1,1,1)
- local saveBtn = Instance.new("TextButton", configPanel); saveBtn.Size = UDim2.new(0.46,0,0,30); saveBtn.Position = UDim2.new(0.02,0,0, 8 +36 + 44); saveBtn.Text="Salvar"; saveBtn.BackgroundColor3 = Color3.fromRGB(60,60,60); saveBtn.TextColor3 = Color3.new(1,1,1); Instance.new("UICorner", saveBtn)
- local loadBtn = Instance.new("TextButton", configPanel); loadBtn.Size = UDim2.new(0.46,0,0,30); loadBtn.Position = UDim2.new(0.50,0,0, 8 +36 + 44); loadBtn.Text="Carregar"; loadBtn.BackgroundColor3 = Color3.fromRGB(60,60,60); loadBtn.TextColor3 = Color3.new(1,1,1); Instance.new("UICorner", loadBtn)
- local delBtn = Instance.new("TextButton", configPanel); delBtn.Size = UDim2.new(0.96,0,0,30); delBtn.Position = UDim2.new(0.02,0,0, 8 +36 + 84); delBtn.Text="Apagar selecionado"; delBtn.BackgroundColor3 = Color3.fromRGB(60,60,60); delBtn.TextColor3 = Color3.new(1,1,1); Instance.new("UICorner", delBtn)
- saveBtn.MouseButton1Click:Connect(function()
- if not HAS_FILE then return end
- local name = tostring(saveBox.Text or ""):gsub("^%s*(.-)%s*$","%1")
- if name == "" then return end
- savedConfigs[name] = { Settings = Settings, Mods_Weapons = Settings.Mods_Weapons, TeamFilter = Settings.TeamFilter }
- pcall(function() writefile(CONFIG_FILENAME, HttpService:JSONEncode(savedConfigs)) end)
- rebuildCfgList()
- end)
- loadBtn.MouseButton1Click:Connect(function()
- if not selectedCfg then return end
- local conf = savedConfigs[selectedCfg]
- if not conf then return end
- applyConfig(conf)
- end)
- delBtn.MouseButton1Click:Connect(function()
- if not selectedCfg then return end
- savedConfigs[selectedCfg] = nil
- if HAS_FILE then pcall(function() writefile(CONFIG_FILENAME, HttpService:JSONEncode(savedConfigs)) end) end
- rebuildCfgList()
- end)
- local autoLoadBtn = Instance.new("TextButton", configPanel)
- autoLoadBtn.Size = UDim2.new(0.96,0,0,24)
- autoLoadBtn.Position = UDim2.new(0.02,0,0, 8 +36 + 118)
- autoLoadBtn.Text = "Auto Carregar : "..(Settings.AutoLoadConfigs and "ON" or "OFF")
- autoLoadBtn.BackgroundColor3 = Color3.fromRGB(45,45,45)
- autoLoadBtn.TextColor3 = Color3.new(1,1,1)
- Instance.new("UICorner", autoLoadBtn)
- autoLoadBtn.MouseButton1Click:Connect(function()
- Settings.AutoLoadConfigs = not Settings.AutoLoadConfigs
- autoLoadBtn.Text = "Auto Carregar : "..(Settings.AutoLoadConfigs and "ON" or "OFF")
- if HAS_FILE then pcall(function() writefile(AUTOLOAD_FILENAME, HttpService:JSONEncode({ auto = Settings.AutoLoadConfigs })) end) end
- if Settings.AutoLoadConfigs then
- local first = nil
- for n,_ in pairs(savedConfigs) do first = n; break end
- if first then selectedCfg = first; applyConfig(savedConfigs[first]); rebuildCfgList() end
- end
- end)
- end
- -- ================= FOV drawing
- local fovCircle = nil
- local fovGui = nil
- if HAS_DRAWING then
- pcall(function()
- fovCircle = Drawing.new("Circle")
- fovCircle.NumSides = 64; fovCircle.Thickness = 2; fovCircle.Filled = false
- fovCircle.Color = Color3.new(1,1,1)
- fovCircle.Visible = false
- fovCircle.Radius = Settings.FOVRadius
- end)
- else
- pcall(function()
- fovGui = Instance.new("Frame", gui)
- fovGui.Name = "FOV_Fallback"
- fovGui.Size = UDim2.new(0, Settings.FOVRadius*2, 0, Settings.FOVRadius*2)
- fovGui.Position = UDim2.new(0.5, -Settings.FOVRadius, 0.5, -Settings.FOVRadius)
- fovGui.BackgroundTransparency = 1
- fovGui.Visible = false
- local circ = Instance.new("Frame", fovGui)
- circ.Size = UDim2.new(1,0,1,0)
- circ.Position = UDim2.new(0,0,0,0)
- circ.BackgroundTransparency = 1
- local corner = Instance.new("UICorner", circ); corner.CornerRadius = UDim.new(1,0)
- local stroke = Instance.new("UIStroke", circ); stroke.Thickness = 2; stroke.Color = Color3.new(1,1,1)
- end)
- end
- -- ================= MAIN LOOP =====================
- local UPDATE_RATE = 0.09
- RunService.RenderStepped:Connect(function(dt)
- pcall(function() updateCameraMovement(dt) end)
- local ok, candidates = pcall(function() return gatherCandidates() end)
- if ok and candidates then
- local bp, bpart = findBestTarget(candidates)
- if Settings.SilentAim then
- if bp and bpart then currentPlayer = bp; currentTargetPart = bpart else currentPlayer = nil; currentTargetPart = nil end
- else currentPlayer = nil; currentTargetPart = nil end
- else currentPlayer = nil; currentTargetPart = nil end
- if Settings.ErrarTiros and currentPlayer then cachedMissProb = computeMissProbability(currentPlayer); cachedMissTarget = currentPlayer else cachedMissProb = 0; cachedMissTarget = nil end
- if fovCircle then pcall(function() fovCircle.Position = Camera.ViewportSize/2; fovCircle.Radius = Settings.FOVRadius; fovCircle.Visible = Settings.ShowFOV end)
- elseif fovGui then pcall(function() fovGui.Visible = Settings.ShowFOV; fovGui.Size = UDim2.new(0, Settings.FOVRadius*2, 0, Settings.FOVRadius*2); fovGui.Position = UDim2.new(0.5, -Settings.FOVRadius, 0.5, -Settings.FOVRadius) end) end
- if Settings.ESP then
- for _,p in ipairs(Players:GetPlayers()) do if p~=LP then pcall(function() updateESPForPlayer(p) end) end end
- end
- end)
- -- fallback cleanup loop
- task.spawn(function()
- while true do
- if not Settings.ESP then
- for _,p in ipairs(Players:GetPlayers()) do pcall(function() clearESPForPlayer(p) end) end
- end
- task.wait(UPDATE_RATE)
- end
- end)
- -- Tool camera fix
- local function connectToolCameraFix(tool)
- if not tool then return end
- if tool:IsA("Tool") then
- tool.Equipped:Connect(function() task.defer(function() pcall(function() Camera.CameraSubject = LP.Character:FindFirstChildOfClass("Humanoid") end) end) end)
- tool.Unequipped:Connect(function() task.defer(function() pcall(function() Camera.CameraSubject = LP.Character:FindFirstChildOfClass("Humanoid") end) end) end)
- end
- end
- local function scanToolsForCamera()
- if LP.Character then for _,c in ipairs(LP.Character:GetChildren()) do if c:IsA("Tool") then connectToolCameraFix(c) end end end
- end
- if LP.Character then scanToolsForCamera() end
- LP.CharacterAdded:Connect(function() task.wait(0.1); scanToolsForCamera() end)
- -- Cleanup on exit
- LP.AncestryChanged:Connect(function()
- if not LP:IsDescendantOf(game) then
- if HAS_DRAWING and fovCircle then pcall(function() fovCircle.Visible=false; fovCircle:Remove() end) end
- if fovGui then pcall(function() fovGui:Destroy() end) end
- for p,_ in pairs(espCache) do clearESPForPlayer(p) end
- if gui and gui.Parent then pcall(function() gui:Destroy() end) end
- if optimizationApplied then pcall(function() applyOptimization(false) end) end
- end
- end)
- -- Auto-apply Optimization at start if Settings.Optimization true
- if Settings.Optimization then pcall(function() applyOptimization(true) end) end
- -- Final prints
- if not CAN_HOOK then warn("[DeltaFinal] Hook limitado.") else print("[DeltaFinal] Hook ativo.") end
- if not HAS_DRAWING then print("[DeltaFinal] Drawing indisponível: FOV usa fallback GUI.") end
- if not HAS_FILE then print("[DeltaFinal] writefile/readfile indisponível: salvar configs desativado.") end
- print("✅ SCRIPT FINAL (Tremor ao pegar armas) carregado — cole como LocalScript em StarterPlayer -> StarterPlayerScripts")
- --====================================================
- -- Fim do SCRIPT FINAL
- --====================================================
Advertisement
Add Comment
Please, Sign In to add comment