-- [[ Rscripts Risk Notice ]] -- This script is not verified by rscripts.net. Deal with caution. -- -- Stay safe: -- • Never log in on unofficial Roblox sites or lookalike domains. -- • Real Roblox links use roblox.com (check the .com ending). -- • Treat fake Roblox login / "claim reward" pages as phishing. -- [[ End Rscripts Risk Notice ]] -- Mira NPC + boton de disparo + prediccion de movimiento -- LocalScript en StarterPlayerScripts local Players = game:GetService("Players") local RunService = game:GetService("RunService") local Workspace = game:GetService("Workspace") local player = Players.LocalPlayer local playerGui = player:WaitForChild("PlayerGui") local RADIO = 100 local INTERVALO_BUSQUEDA = 0.15 local INTERVALO_LISTA = 1 -- Configuracion de prediccion local TIEMPO_PREDICCION = 0.20 local MAX_TIEMPO_PREDICCION = 0.60 local VELOCIDAD_MINIMA = 1 local objetivoActual = nil local cabezaActual = nil local colorOriginal = nil local listaNPCs = {} local tiempoBusqueda = 0 local tiempoLista = 0 -- Guardar velocidad y posicion anteriores de cada NPC local datosMovimiento = {} -- Exclusiones por nombre y equipo local function ignorarNPC(modelo) local nombre = modelo.Name:lower() -- Ignorar siempre if nombre == "machinegun" or nombre == "freecam" or nombre == "ads" or nombre == "mannlicher m1895" or nombre == "atrifle" then return true end local team = player.Team local nombreEquipo = team and team.Name:lower() or "" -- Allied Powers: ignorar British, American y French if nombreEquipo:find("allied") or nombreEquipo:find("allies") then if nombre:find("british") or nombre:find("american") or nombre:find("french") then return true end end -- Central Powers: ignorar German, Austrian y Austro-Hungarian if nombreEquipo:find("central") then if nombre:find("german") or nombre:find("austrian") or nombre:find("austro%-hungarian") then return true end end return false end -- Actualizar lista de NPCs local function actualizarListaNPCs() local nuevaLista = {} for _, objeto in ipairs(Workspace:GetDescendants()) do if objeto:IsA("Model") and objeto ~= player.Character and not Players:GetPlayerFromCharacter(objeto) then local humanoid = objeto:FindFirstChildOfClass("Humanoid") local cabeza = objeto:FindFirstChild("Head") if humanoid and cabeza and cabeza:IsA("BasePart") then table.insert(nuevaLista, objeto) end end end listaNPCs = nuevaLista end -- Obtener la parte central del NPC local function obtenerRaizNPC(npc) if not npc then return nil end return npc:FindFirstChild("HumanoidRootPart") or npc:FindFirstChild("Torso") or npc:FindFirstChild("UpperTorso") end -- Calcular la velocidad del NPC y predecir su posicion local function obtenerPosicionPredicha(npc, cabeza) if not npc or not cabeza or not cabeza.Parent then return nil end local raiz = obtenerRaizNPC(npc) if not raiz then return cabeza.Position end local ahora = os.clock() local posicion = raiz.Position local velocidad = raiz.AssemblyLinearVelocity local datos = datosMovimiento[npc] -- Calcular velocidad por desplazamiento si hace falta if datos and datos.tiempoAnterior then local deltaTiempo = ahora - datos.tiempoAnterior if deltaTiempo > 0.001 and deltaTiempo < 1 then local velocidadCalculada = (posicion - datos.posicionAnterior) / deltaTiempo -- Usar la velocidad calculada si es valida if velocidad.Magnitude < VELOCIDAD_MINIMA and velocidadCalculada.Magnitude >= VELOCIDAD_MINIMA then velocidad = velocidadCalculada end end end datosMovimiento[npc] = { posicionAnterior = posicion, tiempoAnterior = ahora } if velocidad.Magnitude < VELOCIDAD_MINIMA then return cabeza.Position end -- Ajustar el tiempo segun la velocidad de movimiento local tiempo = math.clamp( TIEMPO_PREDICCION, 0, MAX_TIEMPO_PREDICCION ) -- Predecir el desplazamiento horizontal y vertical local desplazamiento = velocidad * tiempo -- Limitar el desplazamiento vertical desplazamiento = Vector3.new( desplazamiento.X, math.clamp(desplazamiento.Y, -2, 2), desplazamiento.Z ) return cabeza.Position + desplazamiento end -- Wall Check: ignora piezas parcialmente transparentes local function tieneVision(npc, cabeza, camera) if not camera or not npc or not cabeza or not cabeza:IsDescendantOf(npc) then return false end local origen = camera.CFrame.Position local direccion = cabeza.Position - origen local ignorados = { player.Character, camera } local parametros = RaycastParams.new() parametros.FilterType = Enum.RaycastFilterType.Exclude parametros.IgnoreWater = true for _ = 1, 50 do parametros.FilterDescendantsInstances = ignorados local resultado = Workspace:Raycast( origen, direccion, parametros ) if not resultado then return false end local pieza = resultado.Instance if pieza:IsDescendantOf(npc) then return true end if pieza:IsA("BasePart") and pieza.Transparency > 0 then table.insert(ignorados, pieza) else return false end end return false end -- GUI local gui = Instance.new("ScreenGui") gui.Name = "MiraNPC" gui.ResetOnSpawn = false gui.Parent = playerGui -- Circulo de mira local circulo = Instance.new("Frame") circulo.Name = "Radio" circulo.Size = UDim2.fromOffset(RADIO * 2, RADIO * 2) circulo.AnchorPoint = Vector2.new(0.5, 0.5) circulo.Position = UDim2.fromScale(0.5, 0.5) circulo.BackgroundTransparency = 1 circulo.Parent = gui local esquina = Instance.new("UICorner") esquina.CornerRadius = UDim.new(1, 0) esquina.Parent = circulo local borde = Instance.new("UIStroke") borde.Thickness = 2 borde.Color = Color3.fromRGB(255, 60, 60) borde.Parent = circulo -- Boton de disparo local boton = Instance.new("TextButton") boton.Name = "Disparar" boton.Size = UDim2.fromOffset(180, 48) boton.AnchorPoint = Vector2.new(0.5, 0) boton.Position = UDim2.new(0.5, 0, 0.78, 0) boton.Text = "DISPARAR" boton.TextScaled = true boton.BackgroundColor3 = Color3.fromRGB(40, 40, 40) boton.TextColor3 = Color3.new(1, 1, 1) boton.Parent = gui local estado = Instance.new("TextLabel") estado.Size = UDim2.fromOffset(320, 32) estado.AnchorPoint = Vector2.new(0.5, 0) estado.Position = UDim2.new(0.5, 0, 0.78, -35) estado.BackgroundTransparency = 1 estado.TextColor3 = Color3.new(1, 1, 1) estado.TextScaled = true estado.Text = "Buscando NPC..." estado.Parent = gui -- Restaurar color anterior local function restaurarCabeza() if cabezaActual and cabezaActual.Parent and colorOriginal then cabezaActual.Color = colorOriginal end cabezaActual = nil colorOriginal = nil objetivoActual = nil end -- Seleccionar NPC visible mas cercano al centro local function seleccionarNPC() local camera = Workspace.CurrentCamera local character = player.Character if not camera or not character then restaurarCabeza() return end local centro = camera.ViewportSize / 2 local mejorCabeza = nil local mejorNPC = nil local menorDistancia = RADIO for _, modelo in ipairs(listaNPCs) do if modelo.Parent and modelo ~= character and not ignorarNPC(modelo) then local humanoid = modelo:FindFirstChildOfClass("Humanoid") local cabeza = modelo:FindFirstChild("Head") if humanoid and humanoid.Health > 0 and cabeza and cabeza:IsA("BasePart") then local punto, visible = camera:WorldToViewportPoint(cabeza.Position) if visible and punto.Z > 0 then local distancia = ( Vector2.new(punto.X, punto.Y) - centro ).Magnitude if distancia <= menorDistancia and tieneVision(modelo, cabeza, camera) then menorDistancia = distancia mejorCabeza = cabeza mejorNPC = modelo end end end end end if mejorCabeza ~= cabezaActual then restaurarCabeza() if mejorCabeza then cabezaActual = mejorCabeza objetivoActual = mejorNPC colorOriginal = mejorCabeza.Color end end if cabezaActual and cabezaActual.Parent and objetivoActual and objetivoActual.Parent and not ignorarNPC(objetivoActual) then cabezaActual.Color = Color3.fromRGB(255, 255, 0) borde.Color = Color3.fromRGB(255, 255, 0) estado.Text = "Apuntando: " .. objetivoActual.Name else restaurarCabeza() borde.Color = Color3.fromRGB(255, 60, 60) estado.Text = "No hay NPC visible" end end -- Actualizar lista y seleccion a intervalos RunService.Heartbeat:Connect(function(dt) tiempoLista += dt tiempoBusqueda += dt if tiempoLista >= INTERVALO_LISTA then tiempoLista = 0 actualizarListaNPCs() end if tiempoBusqueda >= INTERVALO_BUSQUEDA then tiempoBusqueda = 0 seleccionarNPC() end end) -- Disparar con Rifle, Carcano M1891, Mannlicher M1895 o Gewehr 98 boton.Activated:Connect(function() local npc = objetivoActual local cabeza = cabezaActual local character = player.Character local camera = Workspace.CurrentCamera if not npc or not npc.Parent or not cabeza or not cabeza.Parent then estado.Text = "Apunta a un NPC primero" return end if ignorarNPC(npc) then restaurarCabeza() estado.Text = "NPC excluido" return end if not camera or not tieneVision(npc, cabeza, camera) then estado.Text = "Obstaculo detectado" return end local root = character and character:FindFirstChild("HumanoidRootPart") if not character or not root then estado.Text = "Personaje no encontrado" return end -- Buscar cualquiera de las cuatro armas local nombresArmas = { "Rifle", "Carcano M1891", "Mannlicher M1895", "Gewehr 98" } local arma = nil for _, nombreArma in ipairs(nombresArmas) do arma = character:FindFirstChild(nombreArma) if arma then break end end if not arma then estado.Text = "Equipa Rifle, Carcano M1891, Mannlicher M1895 o Gewehr 98" return end local evento = arma:FindFirstChild("ShootClient") if not evento or not evento:IsA("RemoteEvent") then estado.Text = "ShootClient no encontrado" return end -- Predecir donde estara la cabeza cuando llegue el disparo local posicionPredicha = obtenerPosicionPredicha(npc, cabeza) if not posicionPredicha then posicionPredicha = cabeza.Position end evento:FireServer( root.Position, posicionPredicha ) estado.Text = "Prediccion: " .. arma.Name end) -- Lista inicial actualizarListaNPCs()