local CoreGui = game:GetService("StarterGui") CoreGui:SetCore("SendNotification", { Title = "Tbao Hub", Text = "By thaibao7444 discord.gg/yJcDBkV39U", Icon = "rbxthumb://type=Asset&id=15485121479&w=150&h=150", Duration = math.huge, Callback = AllowRunServiceBind, }) getgenv().enabled = true getgenv().aimpart = "HumanoidRootPart" --Head local replicated_storage = game:GetService("ReplicatedStorage") local players = game:GetService("Players") local camera = workspace.CurrentCamera local utility = require(replicated_storage:FindFirstChild("Modules").Utility) local function getPlayersOrEntities() local entities = {} for _, child in ipairs(workspace:GetChildren()) do if child:FindFirstChildOfClass("Humanoid") then table.insert(entities, child) elseif child.Name == "HurtEffect" then for _, hurtPlayer in ipairs(child:GetChildren()) do if hurtPlayer.ClassName ~= "Highlight" then table.insert(entities, hurtPlayer) end end end end return entities end local function isEnemy(player) if not getgenv().teamcheck then return true end return player.Team ~= players.LocalPlayer.Team end local function getClosestPlayer() if not getgenv().enabled then return nil end local closest, closestDistance = nil, math.huge local localPlayer = players.LocalPlayer local character = localPlayer.Character if not character then return nil end for _, player in ipairs(getPlayersOrEntities()) do if player == localPlayer then continue end if not player:FindFirstChild(getgenv().aimpart) then continue end if not isEnemy(player) then continue end local position, onScreen = camera:WorldToViewportPoint(player[getgenv().aimpart].Position) if not onScreen then continue end local center = Vector2.new(camera.ViewportSize.X / 2, camera.ViewportSize.Y / 2) local distance = (center - Vector2.new(position.X, position.Y)).Magnitude if distance < closestDistance then closest = player closestDistance = distance end end return closest end local oldRaycast = utility.Raycast utility.Raycast = function(...) local arguments = { ... } if #arguments > 0 and arguments[4] == 999 then local closest = getClosestPlayer() if closest then arguments[3] = closest[getgenv().aimpart].Position end end return oldRaycast(table.unpack(arguments)) end