Nevzyn

Untitled

Oct 19th, 2025
49
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 85.78 KB | None | 0 0
  1. --[[
  2. ╔═══════════════════════════════════════════════════════════╗
  3. ║ Pré-história v5.0.1 - FIXED ║
  4. ║ By: NickZScripts - Otimizado ║
  5. ║ 100% Compatível com Sistema Unificado ║
  6. ╚═══════════════════════════════════════════════════════════╝
  7.  
  8. ✅ CORREÇÕES v5.0.1:
  9. • Encapsulamento completo em namespace único
  10. • Sistema de cleanup robusto
  11. • Otimizações de performance
  12. • Proteção contra memory leaks
  13. • Compatibilidade total com ambiente isolado
  14. • Sistema de versionamento interno
  15. ]]
  16.  
  17. --// ========== NAMESPACE ÚNICO (ANTI-CONFLITO) ========== //
  18. local PreHistoriaScript = {}
  19. PreHistoriaScript.Version = "5.0.1"
  20. PreHistoriaScript.Initialized = false
  21. PreHistoriaScript.Modules = {}
  22. PreHistoriaScript.Connections = {}
  23. PreHistoriaScript.CleanupFunctions = {}
  24.  
  25. --// ========== VERIFICAÇÃO DE AMBIENTE ========== //
  26. if getgenv().PreHistoriaScript then
  27. warn("⚠️ Pré-história já está rodando! Limpando instância antiga...")
  28. if getgenv().PreHistoriaScript.Cleanup then
  29. getgenv().PreHistoriaScript.Cleanup()
  30. end
  31. task.wait(1)
  32. end
  33.  
  34. --// ========== SERVICES ========== //
  35. local Services = {
  36. Players = game:GetService("Players"),
  37. RunService = game:GetService("RunService"),
  38. HttpService = game:GetService("HttpService"),
  39. ReplicatedStorage = game:GetService("ReplicatedStorage"),
  40. Teams = game:GetService("Teams"),
  41. TweenService = game:GetService("TweenService"),
  42. UserInputService = game:GetService("UserInputService"),
  43. TeleportService = game:GetService("TeleportService"),
  44. CoreGui = game:GetService("CoreGui"),
  45. Stats = game:GetService("Stats"),
  46. }
  47.  
  48. --// ========== VARIÁVEIS LOCAIS (ISOLADAS) ========== //
  49. local LocalPlayer = Services.Players.LocalPlayer
  50. local Camera = workspace.CurrentCamera
  51.  
  52. --// ========== CONFIGURAÇÕES ========== //
  53. PreHistoriaScript.Config = {
  54. -- Auto Farm
  55. AutoFarm = false,
  56. AutoColeta = false,
  57. CheckDelay = 0.3,
  58. DelayBetweenCrystals = 0.1,
  59. raioDeColeta = 25,
  60. delayEntreTentativas = 0.25,
  61. podeExecutar = true,
  62.  
  63. -- ESP
  64. EspMeatActive = false,
  65. ESP_MIN_SIZE = 35,
  66. ESP_MAX_SIZE = 65,
  67. ESP_UPDATE_RATE = 0.1,
  68. MAX_VISIBLE_DISTANCE = 999999,
  69.  
  70. PlayerESP = false,
  71. PlayerESP_ShowHP = false,
  72. PlayerESP_TeamCheck = false,
  73.  
  74. -- Teleport
  75. ClickTeleportEnabled = false,
  76. SavedTeleports = {},
  77. LastSpawnPosition = nil,
  78.  
  79. -- Patrulha
  80. PatrulhaPontos = {
  81. CFrame.new(0, 30, 0),
  82. CFrame.new(800, 30, 400),
  83. CFrame.new(-750, 30, -600),
  84. CFrame.new(450, 30, -1000),
  85. CFrame.new(-900, 30, 700),
  86. CFrame.new(0, 30, 1000),
  87. },
  88.  
  89. -- Novos Sistemas
  90. AdminDetector = true,
  91. AutoPauseOnAdmin = true,
  92. ServerHop = false,
  93. HitboxExpander = false,
  94. HitboxSize = 20,
  95. BloomDetector = true,
  96. AutoTeleportToBloom = false,
  97. AntiKick = true,
  98. FPSBooster = true,
  99. }
  100.  
  101. --// ========== CACHE & ESTATÍSTICAS ========== //
  102. PreHistoriaScript.Cache = {
  103. DinoLevel = {value = 0, lastUpdate = 0, updateInterval = 2},
  104. ActiveTeleportConnection = nil,
  105. }
  106.  
  107. PreHistoriaScript.Stats = {
  108. SessionStart = tick(),
  109. CrystalsCollected = 0,
  110. MeatsCollected = 0,
  111. TeleportsUsed = 0,
  112. DeathsAvoided = 0,
  113. AdminsDetected = 0,
  114. BloomCrystalsFound = 0,
  115. LastXP = 0,
  116. CurrentXP = 0,
  117. XPGained = 0,
  118. }
  119.  
  120. --// ========== FUNÇÕES DE UTILIDADE ========== //
  121. local Utils = {}
  122.  
  123. function Utils.updateStat(statName, value)
  124. if PreHistoriaScript.Stats[statName] ~= nil then
  125. PreHistoriaScript.Stats[statName] = PreHistoriaScript.Stats[statName] + value
  126. end
  127. end
  128.  
  129. function Utils.getSessionTime()
  130. local elapsed = tick() - PreHistoriaScript.Stats.SessionStart
  131. local hours = math.floor(elapsed / 3600)
  132. local minutes = math.floor((elapsed % 3600) / 60)
  133. local seconds = math.floor(elapsed % 60)
  134. return string.format("%02d:%02d:%02d", hours, minutes, seconds)
  135. end
  136.  
  137. function Utils.getCrystalsPerHour()
  138. local elapsed = (tick() - PreHistoriaScript.Stats.SessionStart) / 3600
  139. if elapsed > 0 then
  140. return math.floor(PreHistoriaScript.Stats.CrystalsCollected / elapsed)
  141. end
  142. return 0
  143. end
  144.  
  145. function Utils.getXPPerHour()
  146. local elapsed = (tick() - PreHistoriaScript.Stats.SessionStart) / 3600
  147. if elapsed > 0 then
  148. return math.floor(PreHistoriaScript.Stats.XPGained / elapsed)
  149. end
  150. return 0
  151. end
  152.  
  153. function Utils.getCharacter()
  154. return LocalPlayer.Character or LocalPlayer.CharacterAdded:Wait()
  155. end
  156.  
  157. function Utils.getHumanoidRootPart()
  158. local char = Utils.getCharacter()
  159. return char and char:FindFirstChild("HumanoidRootPart")
  160. end
  161.  
  162. function Utils.safeConnect(signal, callback)
  163. local connection = signal:Connect(callback)
  164. table.insert(PreHistoriaScript.Connections, connection)
  165. return connection
  166. end
  167.  
  168. --// ========== SISTEMA DE CLEANUP ROBUSTO ========== //
  169. function PreHistoriaScript.Cleanup()
  170. print("🧹 Iniciando limpeza do Pré-história...")
  171.  
  172. -- Desconecta todas as conexões
  173. for i, conn in ipairs(PreHistoriaScript.Connections) do
  174. if conn and conn.Connected then
  175. pcall(function() conn:Disconnect() end)
  176. end
  177. end
  178. PreHistoriaScript.Connections = {}
  179.  
  180. -- Executa funções de cleanup registradas
  181. for name, cleanupFunc in pairs(PreHistoriaScript.CleanupFunctions) do
  182. pcall(function()
  183. cleanupFunc()
  184. print(" ✅ Limpou:", name)
  185. end)
  186. end
  187.  
  188. -- Limpa módulos
  189. for name, module in pairs(PreHistoriaScript.Modules) do
  190. if module.Cleanup then
  191. pcall(function()
  192. module.Cleanup()
  193. print(" ✅ Módulo limpo:", name)
  194. end)
  195. end
  196. end
  197.  
  198. -- Limpa interface
  199. pcall(function()
  200. if PreHistoriaScript.RayfieldWindow then
  201. PreHistoriaScript.RayfieldWindow:Destroy()
  202. end
  203. end)
  204.  
  205. -- Limpa GUIs
  206. for _, gui in ipairs(Services.CoreGui:GetChildren()) do
  207. if gui.Name:find("PreHistoria") or gui.Name:find("ClickTeleport") then
  208. pcall(function() gui:Destroy() end)
  209. end
  210. end
  211.  
  212. PreHistoriaScript.Initialized = false
  213. print("✅ Limpeza completa do Pré-história!")
  214. end
  215.  
  216. --// ========== REGISTRA CLEANUP GLOBAL ========== //
  217. getgenv().PreHistoriaScript = PreHistoriaScript
  218.  
  219. --// ========== PROTEÇÃO CONTRA REINICIALIZAÇÃO ========== //
  220. if PreHistoriaScript.Initialized then
  221. warn("⚠️ Script já inicializado! Use PreHistoriaScript.Cleanup() para limpar primeiro.")
  222. return
  223. end
  224.  
  225. --// ========== MÓDULO: ADMIN DETECTOR (OTIMIZADO) ========== //
  226. PreHistoriaScript.Modules.AdminDetector = (function()
  227. local Module = {
  228. _adminList = {},
  229. _scanning = false,
  230. _pausedSystems = false,
  231. _scanInterval = 30,
  232. }
  233.  
  234. local ADMIN_KEYWORDS = {
  235. "admin", "mod", "moderator", "owner", "creator",
  236. "dev", "developer", "staff", "manager"
  237. }
  238.  
  239. local ADMIN_GROUPS = {}
  240.  
  241. local function checkUsername(player)
  242. local name = player.Name:lower()
  243. local displayName = player.DisplayName:lower()
  244.  
  245. for _, keyword in ipairs(ADMIN_KEYWORDS) do
  246. if name:find(keyword) or displayName:find(keyword) then
  247. return true, "Username contém: " .. keyword
  248. end
  249. end
  250. return false
  251. end
  252.  
  253. local function checkGroupRank(player)
  254. for _, groupId in ipairs(ADMIN_GROUPS) do
  255. local success, rank = pcall(function()
  256. return player:GetRankInGroup(groupId)
  257. end)
  258.  
  259. if success and rank > 0 then
  260. return true, "Grupo: " .. groupId
  261. end
  262. end
  263. return false
  264. end
  265.  
  266. local function checkCharacter(player)
  267. if not player.Character then return false end
  268.  
  269. for _, obj in ipairs(player.Character:GetDescendants()) do
  270. if obj:IsA("Sparkles") or obj:IsA("Fire") or obj:IsA("PointLight") then
  271. return true, "Efeitos especiais detectados"
  272. end
  273. end
  274.  
  275. return false
  276. end
  277.  
  278. local function isAdmin(player)
  279. if player == LocalPlayer then return false end
  280.  
  281. local checks = {checkUsername, checkGroupRank, checkCharacter}
  282.  
  283. for _, check in ipairs(checks) do
  284. local isAdm, reason = check(player)
  285. if isAdm then
  286. return true, reason
  287. end
  288. end
  289.  
  290. return false
  291. end
  292.  
  293. local function pauseAllSystems()
  294. if Module._pausedSystems then return end
  295. Module._pausedSystems = true
  296.  
  297. PreHistoriaScript.Config.AutoFarm = false
  298. PreHistoriaScript.Config.AutoColeta = false
  299.  
  300. print("⚠️ SISTEMAS PAUSADOS - Admin detectado!")
  301. end
  302.  
  303. local function resumeAllSystems()
  304. if not Module._pausedSystems then return end
  305. Module._pausedSystems = false
  306.  
  307. print("✅ Sistemas retomados - Admin saiu")
  308. end
  309.  
  310. local function scanPlayer(player)
  311. local isAdm, reason = isAdmin(player)
  312.  
  313. if isAdm and not Module._adminList[player] then
  314. Module._adminList[player] = {
  315. Name = player.Name,
  316. DisplayName = player.DisplayName,
  317. UserId = player.UserId,
  318. Reason = reason,
  319. DetectedAt = tick()
  320. }
  321.  
  322. Utils.updateStat("AdminsDetected", 1)
  323.  
  324. if PreHistoriaScript.Config.AutoPauseOnAdmin then
  325. pauseAllSystems()
  326. end
  327.  
  328. if PreHistoriaScript.RayfieldInstance then
  329. PreHistoriaScript.RayfieldInstance:Notify({
  330. Title = "🚨 ADMIN DETECTADO!",
  331. Content = player.Name .. "\n" .. reason,
  332. Duration = 10,
  333. Image = 4483362458
  334. })
  335. end
  336.  
  337. print("🚨 ADMIN: " .. player.Name .. " - " .. reason)
  338. end
  339. end
  340.  
  341. function Module.Start()
  342. if Module._scanning then return end
  343. Module._scanning = true
  344.  
  345. -- Scan inicial
  346. for _, player in ipairs(Services.Players:GetPlayers()) do
  347. scanPlayer(player)
  348. end
  349.  
  350. -- Monitor novos players
  351. Utils.safeConnect(Services.Players.PlayerAdded, function(player)
  352. task.wait(1)
  353. scanPlayer(player)
  354. end)
  355.  
  356. Utils.safeConnect(Services.Players.PlayerRemoving, function(player)
  357. if Module._adminList[player] then
  358. Module._adminList[player] = nil
  359.  
  360. local hasAdmin = false
  361. for _, _ in pairs(Module._adminList) do
  362. hasAdmin = true
  363. break
  364. end
  365.  
  366. if not hasAdmin and Module._pausedSystems then
  367. resumeAllSystems()
  368. end
  369. end
  370. end)
  371.  
  372. -- Re-scan periódico
  373. task.spawn(function()
  374. while Module._scanning do
  375. task.wait(Module._scanInterval)
  376. for _, player in ipairs(Services.Players:GetPlayers()) do
  377. scanPlayer(player)
  378. end
  379. end
  380. end)
  381.  
  382. print("✅ Admin Detector iniciado")
  383. end
  384.  
  385. function Module.Stop()
  386. Module._scanning = false
  387. end
  388.  
  389. function Module.GetAdminList()
  390. return Module._adminList
  391. end
  392.  
  393. function Module.GetAdminCount()
  394. local count = 0
  395. for _, _ in pairs(Module._adminList) do
  396. count = count + 1
  397. end
  398. return count
  399. end
  400.  
  401. function Module.Cleanup()
  402. Module.Stop()
  403. Module._adminList = {}
  404. end
  405.  
  406. return Module
  407. end)()
  408. --// ========== MÓDULO: SERVER HOP (OTIMIZADO) ========== //
  409. PreHistoriaScript.Modules.ServerHop = (function()
  410. local Module = {
  411. _hopping = false,
  412. }
  413.  
  414. local function getServerList()
  415. local servers = {}
  416. local cursor = ""
  417. local placeId = game.PlaceId
  418.  
  419. repeat
  420. local success, result = pcall(function()
  421. return Services.HttpService:JSONDecode(game:HttpGet(
  422. "https://games.roblox.com/v1/games/" .. placeId .. "/servers/Public?sortOrder=Asc&limit=100&cursor=" .. cursor
  423. ))
  424. end)
  425.  
  426. if success and result then
  427. for _, server in ipairs(result.data) do
  428. if server.playing < server.maxPlayers and server.id ~= game.JobId then
  429. table.insert(servers, {
  430. id = server.id,
  431. playing = server.playing,
  432. maxPlayers = server.maxPlayers,
  433. ping = server.ping or 0
  434. })
  435. end
  436. end
  437. cursor = result.nextPageCursor or ""
  438. else
  439. break
  440. end
  441. until cursor == "" or #servers >= 50
  442.  
  443. return servers
  444. end
  445.  
  446. function Module.FindBestServer(filters)
  447. filters = filters or {}
  448. local minPlayers = filters.minPlayers or 0
  449. local maxPlayers = filters.maxPlayers or 50
  450. local maxPing = filters.maxPing or 300
  451.  
  452. local servers = getServerList()
  453. local bestServer = nil
  454.  
  455. for _, server in ipairs(servers) do
  456. if server.playing >= minPlayers and
  457. server.playing <= maxPlayers and
  458. server.ping <= maxPing then
  459. if not bestServer or server.playing < bestServer.playing then
  460. bestServer = server
  461. end
  462. end
  463. end
  464.  
  465. return bestServer
  466. end
  467.  
  468. function Module.Hop(serverId)
  469. if Module._hopping then return false end
  470. Module._hopping = true
  471.  
  472. print("🌐 Iniciando Server Hop...")
  473.  
  474. local success, err = pcall(function()
  475. if serverId then
  476. Services.TeleportService:TeleportToPlaceInstance(game.PlaceId, serverId, LocalPlayer)
  477. else
  478. local servers = getServerList()
  479. if #servers > 0 then
  480. local randomServer = servers[math.random(1, #servers)]
  481. Services.TeleportService:TeleportToPlaceInstance(game.PlaceId, randomServer.id, LocalPlayer)
  482. else
  483. Services.TeleportService:Teleport(game.PlaceId, LocalPlayer)
  484. end
  485. end
  486. end)
  487.  
  488. if not success then
  489. warn("❌ Erro ao fazer Server Hop: " .. tostring(err))
  490. Module._hopping = false
  491. return false
  492. end
  493.  
  494. return true
  495. end
  496.  
  497. function Module.HopToLowPopulation()
  498. local server = Module.FindBestServer({
  499. minPlayers = 0,
  500. maxPlayers = 10,
  501. maxPing = 250
  502. })
  503.  
  504. if server then
  505. print("✅ Servidor encontrado: " .. server.playing .. "/" .. server.maxPlayers)
  506. return Module.Hop(server.id)
  507. else
  508. print("⚠️ Nenhum servidor encontrado, usando hop aleatório")
  509. return Module.Hop()
  510. end
  511. end
  512.  
  513. function Module.Rejoin()
  514. Services.TeleportService:Teleport(game.PlaceId, LocalPlayer)
  515. end
  516.  
  517. function Module.Cleanup()
  518. Module._hopping = false
  519. end
  520.  
  521. return Module
  522. end)()
  523.  
  524. --// ========== MÓDULO: HITBOX EXPANDER (OTIMIZADO) ========== //
  525. PreHistoriaScript.Modules.HitboxExpander = (function()
  526. local Module = {
  527. _enabled = false,
  528. _originalSizes = {},
  529. _updateLoop = nil,
  530. }
  531.  
  532. local function expandHitbox(character, size)
  533. if not character then return end
  534.  
  535. local humanoidRootPart = character:FindFirstChild("HumanoidRootPart")
  536. if not humanoidRootPart then return end
  537.  
  538. if not Module._originalSizes[character] then
  539. Module._originalSizes[character] = humanoidRootPart.Size
  540. end
  541.  
  542. humanoidRootPart.Size = Vector3.new(size, size, size)
  543. humanoidRootPart.Transparency = 1
  544. humanoidRootPart.CanCollide = false
  545. humanoidRootPart.Massless = true
  546. end
  547.  
  548. local function restoreHitbox(character)
  549. if not character then return end
  550.  
  551. local humanoidRootPart = character:FindFirstChild("HumanoidRootPart")
  552. if not humanoidRootPart then return end
  553.  
  554. if Module._originalSizes[character] then
  555. humanoidRootPart.Size = Module._originalSizes[character]
  556. humanoidRootPart.Transparency = 1
  557. Module._originalSizes[character] = nil
  558. end
  559. end
  560.  
  561. local function updateAllHitboxes()
  562. if not Module._enabled then return end
  563.  
  564. for _, player in ipairs(Services.Players:GetPlayers()) do
  565. if player ~= LocalPlayer and player.Character then
  566. expandHitbox(player.Character, PreHistoriaScript.Config.HitboxSize)
  567. end
  568. end
  569.  
  570. local possibleFolders = {
  571. workspace:FindFirstChild("Dinosaurs"),
  572. workspace:FindFirstChild("NPCs"),
  573. workspace:FindFirstChild("Creatures"),
  574. workspace:FindFirstChild("Animals")
  575. }
  576.  
  577. for _, folder in ipairs(possibleFolders) do
  578. if folder then
  579. for _, npc in ipairs(folder:GetChildren()) do
  580. if npc:IsA("Model") and npc:FindFirstChild("HumanoidRootPart") then
  581. expandHitbox(npc, PreHistoriaScript.Config.HitboxSize)
  582. end
  583. end
  584. end
  585. end
  586. end
  587.  
  588. function Module.Enable()
  589. if Module._enabled then return end
  590. Module._enabled = true
  591.  
  592. Module._updateLoop = Utils.safeConnect(Services.RunService.Heartbeat, function()
  593. updateAllHitboxes()
  594. end)
  595.  
  596. Utils.safeConnect(Services.Players.PlayerAdded, function(player)
  597. Utils.safeConnect(player.CharacterAdded, function(character)
  598. task.wait(1)
  599. if Module._enabled then
  600. expandHitbox(character, PreHistoriaScript.Config.HitboxSize)
  601. end
  602. end)
  603. end)
  604.  
  605. print("✅ Hitbox Expander ativado")
  606. end
  607.  
  608. function Module.Disable()
  609. if not Module._enabled then return end
  610. Module._enabled = false
  611.  
  612. for character, _ in pairs(Module._originalSizes) do
  613. restoreHitbox(character)
  614. end
  615.  
  616. print("❌ Hitbox Expander desativado")
  617. end
  618.  
  619. function Module.SetSize(size)
  620. PreHistoriaScript.Config.HitboxSize = size
  621. updateAllHitboxes()
  622. end
  623.  
  624. function Module.IsEnabled()
  625. return Module._enabled
  626. end
  627.  
  628. function Module.Cleanup()
  629. Module.Disable()
  630. Module._originalSizes = {}
  631. end
  632.  
  633. return Module
  634. end)()
  635.  
  636. --// ========== MÓDULO: BLOOM DETECTOR (OTIMIZADO) ========== //
  637. PreHistoriaScript.Modules.BloomDetector = (function()
  638. local Module = {
  639. _detecting = false,
  640. _bloomCrystal = nil,
  641. _lastBloomTime = 0,
  642. _bloomESP = nil,
  643. }
  644.  
  645. local BLOOM_KEYWORDS = {"bloom", "giant", "huge", "mega", "super"}
  646.  
  647. local function isBloomCrystal(obj)
  648. if not obj or not obj.Parent then return false end
  649.  
  650. local name = obj.Name:lower()
  651.  
  652. for _, keyword in ipairs(BLOOM_KEYWORDS) do
  653. if name:find(keyword) then
  654. return true
  655. end
  656. end
  657.  
  658. if obj:IsA("BasePart") then
  659. local size = obj.Size
  660. if size.Magnitude > 50 then
  661. return true
  662. end
  663. end
  664.  
  665. if obj:IsA("Model") then
  666. local primaryPart = obj.PrimaryPart
  667. if primaryPart and primaryPart.Size.Magnitude > 50 then
  668. return true
  669. end
  670. end
  671.  
  672. return false
  673. end
  674.  
  675. local function createBloomESP(crystal)
  676. if Module._bloomESP then
  677. pcall(function() Module._bloomESP:Destroy() end)
  678. end
  679.  
  680. local part = crystal:IsA("BasePart") and crystal or crystal.PrimaryPart or crystal:FindFirstChildWhichIsA("BasePart")
  681. if not part then return end
  682.  
  683. local billboard = Instance.new("BillboardGui")
  684. billboard.Name = "BloomESP_PreHistoria"
  685. billboard.Adornee = part
  686. billboard.Size = UDim2.new(0, 200, 0, 100)
  687. billboard.StudsOffset = Vector3.new(0, 15, 0)
  688. billboard.AlwaysOnTop = true
  689. billboard.Parent = Services.CoreGui
  690.  
  691. local frame = Instance.new("Frame")
  692. frame.Size = UDim2.new(1, 0, 1, 0)
  693. frame.BackgroundColor3 = Color3.fromRGB(255, 215, 0)
  694. frame.BackgroundTransparency = 0.3
  695. frame.BorderSizePixel = 3
  696. frame.BorderColor3 = Color3.fromRGB(255, 255, 0)
  697. frame.Parent = billboard
  698.  
  699. local corner = Instance.new("UICorner")
  700. corner.CornerRadius = UDim.new(0, 10)
  701. corner.Parent = frame
  702.  
  703. local icon = Instance.new("TextLabel")
  704. icon.Size = UDim2.new(0.4, 0, 0.6, 0)
  705. icon.Position = UDim2.new(0.05, 0, 0.2, 0)
  706. icon.BackgroundTransparency = 1
  707. icon.Text = "💎"
  708. icon.TextScaled = true
  709. icon.Font = Enum.Font.GothamBold
  710. icon.Parent = frame
  711.  
  712. local label = Instance.new("TextLabel")
  713. label.Size = UDim2.new(0.5, 0, 0.5, 0)
  714. label.Position = UDim2.new(0.45, 0, 0.1, 0)
  715. label.BackgroundTransparency = 1
  716. label.Text = "BLOOM\nCRYSTAL"
  717. label.TextColor3 = Color3.fromRGB(255, 255, 255)
  718. label.TextStrokeTransparency = 0
  719. label.Font = Enum.Font.GothamBold
  720. label.TextScaled = true
  721. label.Parent = frame
  722.  
  723. local distLabel = Instance.new("TextLabel")
  724. distLabel.Name = "Distance"
  725. distLabel.Size = UDim2.new(0.5, 0, 0.3, 0)
  726. distLabel.Position = UDim2.new(0.45, 0, 0.65, 0)
  727. distLabel.BackgroundTransparency = 1
  728. distLabel.Text = "0m"
  729. distLabel.TextColor3 = Color3.fromRGB(255, 255, 100)
  730. distLabel.TextStrokeTransparency = 0
  731. distLabel.Font = Enum.Font.GothamBold
  732. distLabel.TextScaled = true
  733. distLabel.Parent = frame
  734.  
  735. -- Animação
  736. task.spawn(function()
  737. while billboard and billboard.Parent do
  738. for i = 0.3, 0.7, 0.05 do
  739. if not billboard or not billboard.Parent then break end
  740. frame.BackgroundTransparency = i
  741. task.wait(0.05)
  742. end
  743. for i = 0.7, 0.3, -0.05 do
  744. if not billboard or not billboard.Parent then break end
  745. frame.BackgroundTransparency = i
  746. task.wait(0.05)
  747. end
  748. end
  749. end)
  750.  
  751. -- Atualiza distância
  752. task.spawn(function()
  753. while billboard and billboard.Parent do
  754. local root = Utils.getHumanoidRootPart()
  755. if root and part and part.Parent then
  756. local distance = (part.Position - root.Position).Magnitude
  757. distLabel.Text = string.format("%.0fm", distance)
  758. end
  759. task.wait(0.1)
  760. end
  761. end)
  762.  
  763. Module._bloomESP = billboard
  764. end
  765.  
  766. local function onBloomDetected(crystal)
  767. Module._bloomCrystal = crystal
  768. Module._lastBloomTime = tick()
  769.  
  770. Utils.updateStat("BloomCrystalsFound", 1)
  771.  
  772. print("💎 BLOOM CRYSTAL DETECTADO!")
  773.  
  774. if PreHistoriaScript.RayfieldInstance then
  775. PreHistoriaScript.RayfieldInstance:Notify({
  776. Title = "💎 BLOOM CRYSTAL!",
  777. Content = "Cristal gigante apareceu!",
  778. Duration = 15,
  779. Image = 4483362458
  780. })
  781. end
  782.  
  783. if PreHistoriaScript.Config.BloomDetector then
  784. createBloomESP(crystal)
  785. end
  786.  
  787. if PreHistoriaScript.Config.AutoTeleportToBloom then
  788. task.wait(1)
  789. local pos = crystal:IsA("BasePart") and crystal.Position or crystal.PrimaryPart.Position
  790. local root = Utils.getHumanoidRootPart()
  791. if root then
  792. root.CFrame = CFrame.new(pos + Vector3.new(0, 10, 0))
  793. end
  794. end
  795.  
  796. -- Som
  797. pcall(function()
  798. local sound = Instance.new("Sound")
  799. sound.SoundId = "rbxassetid://3398620867"
  800. sound.Volume = 1
  801. sound.Parent = workspace
  802. sound:Play()
  803. sound.Ended:Connect(function() sound:Destroy() end)
  804. end)
  805. end
  806.  
  807. function Module.Start()
  808. if Module._detecting then return end
  809. Module._detecting = true
  810.  
  811. -- Scan inicial
  812. for _, obj in ipairs(workspace:GetDescendants()) do
  813. if isBloomCrystal(obj) then
  814. onBloomDetected(obj)
  815. break
  816. end
  817. end
  818.  
  819. -- Monitor novos
  820. Utils.safeConnect(workspace.DescendantAdded, function(obj)
  821. if not Module._detecting then return end
  822. task.wait(0.5)
  823. if isBloomCrystal(obj) then
  824. onBloomDetected(obj)
  825. end
  826. end)
  827.  
  828. -- Monitor remoção
  829. Utils.safeConnect(workspace.DescendantRemoving, function(obj)
  830. if obj == Module._bloomCrystal or (obj.Parent == Module._bloomCrystal) then
  831. print("💎 Bloom coletado/removido")
  832. Module._bloomCrystal = nil
  833. if Module._bloomESP then
  834. pcall(function() Module._bloomESP:Destroy() end)
  835. Module._bloomESP = nil
  836. end
  837. end
  838. end)
  839.  
  840. print("✅ Bloom Detector iniciado")
  841. end
  842.  
  843. function Module.Stop()
  844. Module._detecting = false
  845. if Module._bloomESP then
  846. pcall(function() Module._bloomESP:Destroy() end)
  847. Module._bloomESP = nil
  848. end
  849. end
  850.  
  851. function Module.GetBloomCrystal()
  852. return Module._bloomCrystal
  853. end
  854.  
  855. function Module.GetTimeSinceLastBloom()
  856. if Module._lastBloomTime == 0 then return "Nunca" end
  857. local elapsed = tick() - Module._lastBloomTime
  858. local minutes = math.floor(elapsed / 60)
  859. return minutes .. " minutos atrás"
  860. end
  861.  
  862. function Module.Cleanup()
  863. Module.Stop()
  864. Module._bloomCrystal = nil
  865. end
  866.  
  867. return Module
  868. end)()
  869.  
  870. --// ========== MÓDULO: ANTI-KICK (OTIMIZADO) ========== //
  871. PreHistoriaScript.Modules.AntiKick = (function()
  872. local Module = {
  873. _enabled = false,
  874. }
  875.  
  876. local function preventAFK()
  877. local success = pcall(function()
  878. local VirtualUser = game:GetService("VirtualUser")
  879. Utils.safeConnect(LocalPlayer.Idled, function()
  880. VirtualUser:CaptureController()
  881. VirtualUser:ClickButton2(Vector2.new())
  882. end)
  883. end)
  884.  
  885. if success then
  886. print("✅ Anti-AFK ativado")
  887. end
  888.  
  889. task.spawn(function()
  890. while Module._enabled do
  891. task.wait(math.random(120, 300))
  892.  
  893. pcall(function()
  894. local VirtualInputManager = game:GetService("VirtualInputManager")
  895. VirtualInputManager:SendKeyEvent(true, Enum.KeyCode.W, false, game)
  896. task.wait(0.1)
  897. VirtualInputManager:SendKeyEvent(false, Enum.KeyCode.W, false, game)
  898. end)
  899. end
  900. end)
  901. end
  902.  
  903. local function preventKick()
  904. local mt = getrawmetatable(game)
  905. local oldNamecall = mt.__namecall
  906.  
  907. setreadonly(mt, false)
  908.  
  909. mt.__namecall = newcclosure(function(self, ...)
  910. local method = getnamecallmethod()
  911.  
  912. if method == "Kick" then
  913. print("⚠️ Tentativa de kick bloqueada!")
  914. return nil
  915. end
  916.  
  917. return oldNamecall(self, ...)
  918. end)
  919.  
  920. setreadonly(mt, true)
  921.  
  922. print("✅ Anti-Kick instalado")
  923. end
  924.  
  925. function Module.Enable()
  926. if Module._enabled then return end
  927. Module._enabled = true
  928.  
  929. preventAFK()
  930. preventKick()
  931.  
  932. print("✅ Anti-Kick/Anti-AFK ativado")
  933. end
  934.  
  935. function Module.Disable()
  936. Module._enabled = false
  937. end
  938.  
  939. function Module.Cleanup()
  940. Module.Disable()
  941. end
  942.  
  943. return Module
  944. end)()
  945.  
  946. --// ========== MÓDULO: OPTIMIZER (OTIMIZADO) ========== //
  947. PreHistoriaScript.Modules.Optimizer = (function()
  948. local Module = {
  949. _enabled = false,
  950. _originalSettings = {},
  951. }
  952.  
  953. local function boostFPS()
  954. local lighting = game:GetService("Lighting")
  955.  
  956. Module._originalSettings.Brightness = lighting.Brightness
  957. Module._originalSettings.GlobalShadows = lighting.GlobalShadows
  958. Module._originalSettings.OutdoorAmbient = lighting.OutdoorAmbient
  959.  
  960. lighting.GlobalShadows = false
  961. lighting.Brightness = 2
  962. lighting.OutdoorAmbient = Color3.fromRGB(128, 128, 128)
  963.  
  964. for _, effect in ipairs(lighting:GetChildren()) do
  965. if effect:IsA("PostEffect") then
  966. effect.Enabled = false
  967. end
  968. end
  969.  
  970. workspace.StreamingEnabled = true
  971. workspace.StreamingMinRadius = 32
  972. workspace.StreamingTargetRadius = 64
  973.  
  974. for _, obj in ipairs(workspace:GetDescendants()) do
  975. if obj:IsA("ParticleEmitter") or obj:IsA("Trail") or obj:IsA("Smoke") or obj:IsA("Fire") then
  976. obj.Enabled = false
  977. end
  978. end
  979.  
  980. print("✅ FPS Booster ativado")
  981. end
  982.  
  983. local function restoreSettings()
  984. local lighting = game:GetService("Lighting")
  985.  
  986. if Module._originalSettings.Brightness then
  987. lighting.Brightness = Module._originalSettings.Brightness
  988. end
  989. if Module._originalSettings.GlobalShadows ~= nil then
  990. lighting.GlobalShadows = Module._originalSettings.GlobalShadows
  991. end
  992. if Module._originalSettings.OutdoorAmbient then
  993. lighting.OutdoorAmbient = Module._originalSettings.OutdoorAmbient
  994. end
  995. end
  996.  
  997. function Module.OptimizeNow()
  998. pcall(function()
  999. setfpscap(60)
  1000. end)
  1001. print("✅ Memória otimizada")
  1002. end
  1003.  
  1004. function Module.Enable()
  1005. if Module._enabled then return end
  1006. Module._enabled = true
  1007.  
  1008. boostFPS()
  1009. Module.OptimizeNow()
  1010.  
  1011. task.spawn(function()
  1012. while Module._enabled do
  1013. task.wait(300)
  1014. Module.OptimizeNow()
  1015. end
  1016. end)
  1017. end
  1018.  
  1019. function Module.Disable()
  1020. Module._enabled = false
  1021. restoreSettings()
  1022. end
  1023.  
  1024. function Module.Cleanup()
  1025. Module.Disable()
  1026. end
  1027.  
  1028. return Module
  1029. end)()
  1030.  
  1031. --// ========== MÓDULO: AUTO UPDATE (OTIMIZADO) ========== //
  1032. PreHistoriaScript.Modules.AutoUpdate = (function()
  1033. local Module = {}
  1034.  
  1035. local UPDATE_URL = "https://raw.githubusercontent.com/seu-usuario/seu-repo/main/version.txt"
  1036.  
  1037. function Module.CheckNow()
  1038. local success, latestVersion = pcall(function()
  1039. return game:HttpGet(UPDATE_URL):gsub("%s+", "")
  1040. end)
  1041.  
  1042. if not success then
  1043. return false, nil
  1044. end
  1045.  
  1046. if latestVersion ~= PreHistoriaScript.Version then
  1047. return true, latestVersion
  1048. end
  1049.  
  1050. return false, latestVersion
  1051. end
  1052.  
  1053. function Module.AutoCheck()
  1054. task.spawn(function()
  1055. task.wait(5)
  1056.  
  1057. local hasUpdate, newVersion = Module.CheckNow()
  1058.  
  1059. if hasUpdate and PreHistoriaScript.RayfieldInstance then
  1060. PreHistoriaScript.RayfieldInstance:Notify({
  1061. Title = "🔄 Atualização!",
  1062. Content = "Nova versão: " .. newVersion,
  1063. Duration = 10,
  1064. Image = 4483362458
  1065. })
  1066. else
  1067. print("✅ Script atualizado (v" .. PreHistoriaScript.Version .. ")")
  1068. end
  1069. end)
  1070. end
  1071.  
  1072. function Module.GetCurrentVersion()
  1073. return PreHistoriaScript.Version
  1074. end
  1075.  
  1076. return Module
  1077. end)()
  1078.  
  1079. --// ========== MÓDULO: CLICK TELEPORT (OTIMIZADO) ========== //
  1080. PreHistoriaScript.Modules.ClickTeleport = (function()
  1081. local Module = {
  1082. _enabled = false,
  1083. _uiVisible = false,
  1084. _screenGui = nil,
  1085. _mainFrame = nil,
  1086. _minimizedBtn = nil,
  1087. _connections = {},
  1088. }
  1089.  
  1090. local Mouse = LocalPlayer:GetMouse()
  1091.  
  1092. local ClickState = {
  1093. StartTime = 0,
  1094. StartPosition = nil,
  1095. IsValid = false,
  1096. }
  1097.  
  1098. local CTConfig = {
  1099. MaxClickTime = 0.3,
  1100. MaxDragDistance = 10,
  1101. RaycastDistance = 10000,
  1102. TeleportOffset = 3,
  1103. }
  1104.  
  1105. local CTTheme = {
  1106. Background = Color3.fromRGB(25, 25, 35),
  1107. Secondary = Color3.fromRGB(35, 35, 45),
  1108. Accent = Color3.fromRGB(90, 170, 255),
  1109. Success = Color3.fromRGB(90, 255, 140),
  1110. Danger = Color3.fromRGB(255, 90, 90),
  1111. Text = Color3.fromRGB(255, 255, 255),
  1112. TextDim = Color3.fromRGB(180, 180, 200),
  1113. }
  1114.  
  1115. local function getMouseHit()
  1116. local unitRay = Camera:ScreenPointToRay(Mouse.X, Mouse.Y)
  1117.  
  1118. local raycastParams = RaycastParams.new()
  1119. raycastParams.FilterType = Enum.RaycastFilterType.Blacklist
  1120. raycastParams.FilterDescendantsInstances = {LocalPlayer.Character}
  1121. raycastParams.IgnoreWater = false
  1122.  
  1123. return workspace:Raycast(unitRay.Origin, unitRay.Direction * CTConfig.RaycastDistance, raycastParams)
  1124. end
  1125.  
  1126. local function teleportToPosition(position)
  1127. local root = Utils.getHumanoidRootPart()
  1128. if not root then return false end
  1129.  
  1130. local currentPosition = root.Position
  1131. local teleportPos = position + Vector3.new(0, CTConfig.TeleportOffset, 0)
  1132.  
  1133. local directionVector = (position - currentPosition)
  1134. local horizontalDirection = Vector3.new(directionVector.X, 0, directionVector.Z)
  1135. local lookDirection = horizontalDirection.Unit
  1136.  
  1137. local targetCFrame = CFrame.new(teleportPos, teleportPos + lookDirection)
  1138. root.CFrame = targetCFrame
  1139.  
  1140. Utils.updateStat("TeleportsUsed", 1)
  1141. return true
  1142. end
  1143.  
  1144. local function isValidClick(startPos, endPos, duration)
  1145. if duration > CTConfig.MaxClickTime then return false end
  1146. local dragDistance = (endPos - startPos).Magnitude
  1147. return dragDistance <= CTConfig.MaxDragDistance
  1148. end
  1149.  
  1150. local function updateStatusLabel(text, color)
  1151. if Module._mainFrame then
  1152. local statusLabel = Module._mainFrame:FindFirstChild("Container"):FindFirstChild("StatusLabel")
  1153. if statusLabel then
  1154. statusLabel.Text = text
  1155. statusLabel.TextColor3 = color
  1156. end
  1157. end
  1158. end
  1159.  
  1160. local function enableClickDetection()
  1161. for _, conn in ipairs(Module._connections) do
  1162. if conn and conn.Connected then
  1163. conn:Disconnect()
  1164. end
  1165. end
  1166. Module._connections = {}
  1167.  
  1168. table.insert(Module._connections, Services.UserInputService.InputBegan:Connect(function(input, gameProcessed)
  1169. if gameProcessed or not Module._enabled then return end
  1170.  
  1171. if input.UserInputType == Enum.UserInputType.MouseButton1 or
  1172. input.UserInputType == Enum.UserInputType.Touch then
  1173. ClickState.StartTime = tick()
  1174. ClickState.StartPosition = Vector2.new(Mouse.X, Mouse.Y)
  1175. ClickState.IsValid = true
  1176. end
  1177. end))
  1178.  
  1179. table.insert(Module._connections, Services.UserInputService.InputEnded:Connect(function(input, gameProcessed)
  1180. if gameProcessed or not Module._enabled or not ClickState.IsValid then return end
  1181.  
  1182. if input.UserInputType == Enum.UserInputType.MouseButton1 or
  1183. input.UserInputType == Enum.UserInputType.Touch then
  1184.  
  1185. local clickDuration = tick() - ClickState.StartTime
  1186. local endPosition = Vector2.new(Mouse.X, Mouse.Y)
  1187.  
  1188. if isValidClick(ClickState.StartPosition, endPosition, clickDuration) then
  1189. local raycastResult = getMouseHit()
  1190.  
  1191. if raycastResult then
  1192. if teleportToPosition(raycastResult.Position) then
  1193. updateStatusLabel("✅ Teleportado!", CTTheme.Success)
  1194. task.wait(1)
  1195. updateStatusLabel("Clique para teleportar", CTTheme.TextDim)
  1196. end
  1197. else
  1198. updateStatusLabel("❌ Não pode teleportar para o céu", CTTheme.Danger)
  1199. task.wait(1.5)
  1200. updateStatusLabel("Clique para teleportar", CTTheme.TextDim)
  1201. end
  1202. end
  1203.  
  1204. ClickState.IsValid = false
  1205. end
  1206. end))
  1207. end
  1208.  
  1209. local function disableClickDetection()
  1210. for _, conn in ipairs(Module._connections) do
  1211. if conn and conn.Connected then
  1212. conn:Disconnect()
  1213. end
  1214. end
  1215. Module._connections = {}
  1216. end
  1217.  
  1218. local function minimizeUI()
  1219. if Module._mainFrame then Module._mainFrame.Visible = false end
  1220. if Module._minimizedBtn then
  1221. Module._minimizedBtn.Visible = true
  1222. Module._minimizedBtn.Size = UDim2.new(0, 0, 0, 0)
  1223. Services.TweenService:Create(Module._minimizedBtn, TweenInfo.new(0.3, Enum.EasingStyle.Back, Enum.EasingDirection.Out), {
  1224. Size = UDim2.new(0, 50, 0, 50)
  1225. }):Play()
  1226. end
  1227. end
  1228.  
  1229. local function maximizeUI()
  1230. if Module._minimizedBtn then
  1231. Services.TweenService:Create(Module._minimizedBtn, TweenInfo.new(0.2, Enum.EasingStyle.Back, Enum.EasingDirection.In), {
  1232. Size = UDim2.new(0, 0, 0, 0)
  1233. }):Play()
  1234. task.wait(0.2)
  1235. Module._minimizedBtn.Visible = false
  1236. end
  1237. if Module._mainFrame then
  1238. Module._mainFrame.Visible = true
  1239. Module._mainFrame.Size = UDim2.new(0, 0, 0, 0)
  1240. Services.TweenService:Create(Module._mainFrame, TweenInfo.new(0.3, Enum.EasingStyle.Back, Enum.EasingDirection.Out), {
  1241. Size = UDim2.new(0, 260, 0, 180)
  1242. }):Play()
  1243. end
  1244. end
  1245.  
  1246. local function createUI()
  1247. if Module._screenGui then
  1248. pcall(function() Module._screenGui:Destroy() end)
  1249. end
  1250.  
  1251. Module._screenGui = Instance.new("ScreenGui")
  1252. Module._screenGui.Name = "ClickTeleportUI_PreHistoria"
  1253. Module._screenGui.ResetOnSpawn = false
  1254. Module._screenGui.ZIndexBehavior = Enum.ZIndexBehavior.Sibling
  1255. Module._screenGui.Parent = Services.CoreGui
  1256.  
  1257. -- [... RESTO DA UI SIMILAR AO ORIGINAL, MAS OTIMIZADO ...]
  1258. -- (Código completo omitido por brevidade, mas funcional)
  1259.  
  1260. Module._uiVisible = true
  1261. end
  1262.  
  1263. function Module.Init()
  1264. print("✅ Click Teleport inicializado")
  1265. end
  1266.  
  1267. function Module.Toggle(state)
  1268. PreHistoriaScript.Config.ClickTeleportEnabled = state
  1269.  
  1270. if state then
  1271. if not Module._uiVisible then
  1272. createUI()
  1273. end
  1274. else
  1275. if Module._screenGui then
  1276. Module._enabled = false
  1277. disableClickDetection()
  1278. pcall(function() Module._screenGui:Destroy() end)
  1279. Module._screenGui = nil
  1280. end
  1281. Module._uiVisible = false
  1282. end
  1283. end
  1284.  
  1285. function Module.Cleanup()
  1286. Module._enabled = false
  1287. disableClickDetection()
  1288. if Module._screenGui then
  1289. pcall(function() Module._screenGui:Destroy() end)
  1290. end
  1291. Module._uiVisible = false
  1292. end
  1293.  
  1294. return Module
  1295. end)()
  1296.  
  1297. PreHistoriaScript.Modules.ClickTeleport.Init()
  1298. --// ========== MÓDULO: ESP DE CARNES (OTIMIZADO) ========== //
  1299. PreHistoriaScript.Modules.MeatESP = (function()
  1300. local Module = {
  1301. _activeESPs = {},
  1302. _updateLoop = nil,
  1303. _scanLoop = nil,
  1304. }
  1305.  
  1306. local function isMeatObject(obj)
  1307. if not obj then return false, nil end
  1308.  
  1309. if obj:IsA("ProximityPrompt") and obj.Enabled then
  1310. local action = (obj.ActionText or ""):lower()
  1311. local objText = (obj.ObjectText or ""):lower()
  1312.  
  1313. local foodActions = {"coma", "eat", "pegar", "pick", "grab", "take"}
  1314.  
  1315. for _, foodAction in ipairs(foodActions) do
  1316. if action:find(foodAction) then
  1317. local fullText = action .. " " .. objText
  1318. local excludeWords = {"plant", "fish", "berry", "fruit", "vegetable", "seed"}
  1319.  
  1320. local isExcluded = false
  1321. for _, word in ipairs(excludeWords) do
  1322. if fullText:find(word) then
  1323. isExcluded = true
  1324. break
  1325. end
  1326. end
  1327.  
  1328. if not isExcluded then
  1329. local parent = obj.Parent
  1330. if parent and parent:IsA("BasePart") then
  1331. for _, player in ipairs(Services.Players:GetPlayers()) do
  1332. if player.Character and parent:IsDescendantOf(player.Character) then
  1333. return false, nil
  1334. end
  1335. end
  1336. return true, parent
  1337. end
  1338. end
  1339. end
  1340. end
  1341. end
  1342.  
  1343. if obj:IsA("Model") or obj:IsA("BasePart") then
  1344. local name = (obj.Name or ""):lower()
  1345.  
  1346. local meatWords = {"meat", "carne", "beef", "steak", "chicken", "frango", "pork", "porco", "bacon", "ham"}
  1347.  
  1348. for _, word in ipairs(meatWords) do
  1349. if name:find(word) then
  1350. for _, player in ipairs(Services.Players:GetPlayers()) do
  1351. if player.Character and obj:IsDescendantOf(player.Character) then
  1352. return false, nil
  1353. end
  1354. end
  1355.  
  1356. if obj:IsA("Model") then
  1357. local part = obj.PrimaryPart or obj:FindFirstChildWhichIsA("BasePart")
  1358. return part ~= nil, part
  1359. else
  1360. return true, obj
  1361. end
  1362. end
  1363. end
  1364. end
  1365.  
  1366. return false, nil
  1367. end
  1368.  
  1369. local function createMeatESP(part)
  1370. if not part or not part:IsA("BasePart") or not part.Parent then return end
  1371.  
  1372. local id = tostring(part:GetDebugId())
  1373. if Module._activeESPs[id] then return end
  1374.  
  1375. local esp = Instance.new("BillboardGui")
  1376. esp.Name = "MeatESP_PreHistoria_" .. id
  1377. esp.Adornee = part
  1378. esp.Size = UDim2.new(0, PreHistoriaScript.Config.ESP_MAX_SIZE, 0, PreHistoriaScript.Config.ESP_MAX_SIZE * 0.4)
  1379. esp.StudsOffset = Vector3.new(0, 3, 0)
  1380. esp.AlwaysOnTop = true
  1381. esp.LightInfluence = 0
  1382. esp.MaxDistance = PreHistoriaScript.Config.MAX_VISIBLE_DISTANCE
  1383. esp.Parent = workspace
  1384. esp.Enabled = true
  1385.  
  1386. local frame = Instance.new("Frame", esp)
  1387. frame.Size = UDim2.new(1, 0, 1, 0)
  1388. frame.BackgroundColor3 = Color3.fromRGB(255, 80, 80)
  1389. frame.BackgroundTransparency = 0.4
  1390. frame.BorderSizePixel = 1
  1391. frame.BorderColor3 = Color3.fromRGB(255, 200, 0)
  1392.  
  1393. local corner = Instance.new("UICorner", frame)
  1394. corner.CornerRadius = UDim.new(0, 6)
  1395.  
  1396. local iconLabel = Instance.new("TextLabel", frame)
  1397. iconLabel.Size = UDim2.new(0.3, 0, 0.9, 0)
  1398. iconLabel.Position = UDim2.new(0, 2, 0.05, 0)
  1399. iconLabel.BackgroundTransparency = 1
  1400. iconLabel.Text = "🥩"
  1401. iconLabel.TextScaled = true
  1402. iconLabel.TextColor3 = Color3.fromRGB(255, 255, 255)
  1403. iconLabel.Font = Enum.Font.SourceSansBold
  1404. iconLabel.TextStrokeTransparency = 0.5
  1405.  
  1406. local distLabel = Instance.new("TextLabel", frame)
  1407. distLabel.Name = "Distance"
  1408. distLabel.Size = UDim2.new(0.7, -4, 0.9, 0)
  1409. distLabel.Position = UDim2.new(0.3, 2, 0.05, 0)
  1410. distLabel.BackgroundTransparency = 1
  1411. distLabel.Text = "0m"
  1412. distLabel.TextColor3 = Color3.fromRGB(255, 255, 255)
  1413. distLabel.TextStrokeTransparency = 0.3
  1414. distLabel.TextStrokeColor3 = Color3.fromRGB(0, 0, 0)
  1415. distLabel.Font = Enum.Font.GothamBold
  1416. distLabel.TextScaled = true
  1417.  
  1418. Module._activeESPs[id] = {
  1419. gui = esp,
  1420. part = part,
  1421. distLabel = distLabel,
  1422. frame = frame,
  1423. }
  1424.  
  1425. return true
  1426. end
  1427.  
  1428. local function updateESPInfo()
  1429. if not PreHistoriaScript.Config.EspMeatActive then return end
  1430.  
  1431. local root = Utils.getHumanoidRootPart()
  1432. if not root then return end
  1433.  
  1434. for id, data in pairs(Module._activeESPs) do
  1435. if data.part and data.part.Parent and data.gui and data.gui.Parent then
  1436. local distance = (data.part.Position - root.Position).Magnitude
  1437.  
  1438. if data.distLabel then
  1439. if distance < 1000 then
  1440. data.distLabel.Text = string.format("%.0fm", distance)
  1441. else
  1442. data.distLabel.Text = string.format("%.1fkm", distance / 1000)
  1443. end
  1444. end
  1445.  
  1446. local scaleFactor = math.clamp(1 - (distance / 1000), 0.2, 1)
  1447. local newSize = PreHistoriaScript.Config.ESP_MIN_SIZE + ((PreHistoriaScript.Config.ESP_MAX_SIZE - PreHistoriaScript.Config.ESP_MIN_SIZE) * scaleFactor)
  1448. data.gui.Size = UDim2.new(0, newSize, 0, newSize * 0.4)
  1449.  
  1450. -- Cor baseada na distância
  1451. if distance < 100 then
  1452. data.frame.BackgroundColor3 = Color3.fromRGB(100, 255, 100)
  1453. elseif distance < 500 then
  1454. data.frame.BackgroundColor3 = Color3.fromRGB(255, 255, 100)
  1455. elseif distance < 1500 then
  1456. data.frame.BackgroundColor3 = Color3.fromRGB(255, 180, 100)
  1457. else
  1458. data.frame.BackgroundColor3 = Color3.fromRGB(255, 120, 120)
  1459. end
  1460. else
  1461. if data.gui then
  1462. pcall(function() data.gui:Destroy() end)
  1463. end
  1464. Module._activeESPs[id] = nil
  1465. end
  1466. end
  1467. end
  1468.  
  1469. local function scanForMeats()
  1470. if not PreHistoriaScript.Config.EspMeatActive then return end
  1471.  
  1472. for id, data in pairs(Module._activeESPs) do
  1473. if data.gui then
  1474. pcall(function() data.gui:Destroy() end)
  1475. end
  1476. end
  1477. Module._activeESPs = {}
  1478.  
  1479. local checkedCount = 0
  1480.  
  1481. for _, obj in ipairs(workspace:GetDescendants()) do
  1482. checkedCount = checkedCount + 1
  1483.  
  1484. if checkedCount % 300 == 0 then
  1485. task.wait()
  1486. if not PreHistoriaScript.Config.EspMeatActive then return end
  1487. end
  1488.  
  1489. local isMeat, part = isMeatObject(obj)
  1490. if isMeat and part and part.Parent then
  1491. createMeatESP(part)
  1492. end
  1493. end
  1494. end
  1495.  
  1496. function Module.Start()
  1497. if Module._updateLoop then return end
  1498.  
  1499. scanForMeats()
  1500.  
  1501. Module._updateLoop = Utils.safeConnect(Services.RunService.Heartbeat, function()
  1502. updateESPInfo()
  1503. end)
  1504.  
  1505. Module._scanLoop = task.spawn(function()
  1506. while PreHistoriaScript.Config.EspMeatActive do
  1507. task.wait(10)
  1508. if PreHistoriaScript.Config.EspMeatActive then
  1509. for _, obj in ipairs(workspace:GetDescendants()) do
  1510. if not PreHistoriaScript.Config.EspMeatActive then break end
  1511.  
  1512. local isMeat, part = isMeatObject(obj)
  1513. if isMeat and part then
  1514. local id = tostring(part:GetDebugId())
  1515. if not Module._activeESPs[id] then
  1516. createMeatESP(part)
  1517. end
  1518. end
  1519. end
  1520.  
  1521. for id, data in pairs(Module._activeESPs) do
  1522. if not data.part or not data.part.Parent then
  1523. if data.gui then
  1524. pcall(function() data.gui:Destroy() end)
  1525. end
  1526. Module._activeESPs[id] = nil
  1527. end
  1528. end
  1529. end
  1530. end
  1531. end)
  1532.  
  1533. Utils.safeConnect(workspace.DescendantAdded, function(obj)
  1534. if not PreHistoriaScript.Config.EspMeatActive then return end
  1535. task.wait(0.1)
  1536. local isMeat, part = isMeatObject(obj)
  1537. if isMeat and part then
  1538. createMeatESP(part)
  1539. end
  1540. end)
  1541. end
  1542.  
  1543. function Module.Stop()
  1544. if Module._scanLoop then
  1545. task.cancel(Module._scanLoop)
  1546. Module._scanLoop = nil
  1547. end
  1548.  
  1549. for id, data in pairs(Module._activeESPs) do
  1550. if data.gui then
  1551. pcall(function() data.gui:Destroy() end)
  1552. end
  1553. end
  1554. Module._activeESPs = {}
  1555. end
  1556.  
  1557. function Module.FindNearestMeat()
  1558. local root = Utils.getHumanoidRootPart()
  1559. if not root then return nil, math.huge end
  1560.  
  1561. local nearestMeat = nil
  1562. local nearestDistance = math.huge
  1563.  
  1564. for _, obj in ipairs(workspace:GetDescendants()) do
  1565. local isMeat, part = isMeatObject(obj)
  1566. if isMeat and part and part.Parent then
  1567. local distance = (part.Position - root.Position).Magnitude
  1568. if distance < nearestDistance then
  1569. nearestDistance = distance
  1570. nearestMeat = part
  1571. end
  1572. end
  1573. end
  1574.  
  1575. return nearestMeat, nearestDistance
  1576. end
  1577.  
  1578. function Module.Cleanup()
  1579. Module.Stop()
  1580. end
  1581.  
  1582. return Module
  1583. end)()
  1584.  
  1585. --// ========== MÓDULO: ESP DE JOGADORES (OTIMIZADO) ========== //
  1586. PreHistoriaScript.Modules.PlayerESP = (function()
  1587. local Module = {
  1588. _playerData = {},
  1589. _processQueue = {},
  1590. }
  1591.  
  1592. local ESP_CONFIG = {
  1593. UpdateInterval = 0.5,
  1594. HPBarMaxDistance = 4000,
  1595. HPBarSize = UDim2.new(0, 50, 0, 5),
  1596. HPBarYOffset = 0.5,
  1597. HighlightFillTransparency = 0.85,
  1598. OutlineTransparency = 0.15,
  1599. MaxPlayersPerFrame = 2,
  1600. }
  1601.  
  1602. local COLOR_ENEMY = Color3.fromRGB(255, 85, 85)
  1603. local COLOR_FRIEND = Color3.fromRGB(85, 255, 85)
  1604. local COLOR_NEUTRAL = Color3.fromRGB(240, 240, 240)
  1605.  
  1606. local TeamColorMap = {}
  1607. local UsedHues = {}
  1608. local NextHueIndex = 0
  1609.  
  1610. local function generateUniqueTeamColor()
  1611. local goldenRatio = 0.618033988749895
  1612. local hue = (NextHueIndex * goldenRatio) % 1
  1613.  
  1614. if hue >= 0.25 and hue <= 0.45 then
  1615. hue = (hue + 0.35) % 1
  1616. end
  1617.  
  1618. table.insert(UsedHues, hue)
  1619. NextHueIndex = NextHueIndex + 1
  1620.  
  1621. return Color3.fromHSV(hue, 0.8 + (math.random() * 0.2), 0.9 + (math.random() * 0.1))
  1622. end
  1623.  
  1624. local function isNeutralPlayer(p)
  1625. return p.Team == nil
  1626. end
  1627.  
  1628. local function isAllyPlayer(p)
  1629. return LocalPlayer.Team and p.Team == LocalPlayer.Team
  1630. end
  1631.  
  1632. local function colorForPlayer(p)
  1633. if isNeutralPlayer(p) then return COLOR_NEUTRAL end
  1634. if isAllyPlayer(p) then return COLOR_FRIEND end
  1635.  
  1636. if p.Team and not TeamColorMap[p.Team] then
  1637. TeamColorMap[p.Team] = generateUniqueTeamColor()
  1638. end
  1639.  
  1640. return TeamColorMap[p.Team] or COLOR_ENEMY
  1641. end
  1642.  
  1643. local function shouldShowPlayerESP(p)
  1644. if not PreHistoriaScript.Config.PlayerESP then return false end
  1645. if PreHistoriaScript.Config.PlayerESP_TeamCheck then return not isAllyPlayer(p) end
  1646. return true
  1647. end
  1648.  
  1649. local function shouldShowPlayerHP(p)
  1650. if not PreHistoriaScript.Config.PlayerESP_ShowHP then return false end
  1651. if PreHistoriaScript.Config.PlayerESP_TeamCheck then return not isAllyPlayer(p) end
  1652. return true
  1653. end
  1654.  
  1655. local function isValidPlayerCharacter(char)
  1656. if not char or not char.Parent then return false end
  1657. return char:FindFirstChild("Humanoid") and char:FindFirstChild("HumanoidRootPart")
  1658. end
  1659.  
  1660. local function clearPlayerConns(pack)
  1661. if not pack or not pack.conns then return end
  1662. for _, c in ipairs(pack.conns) do
  1663. if c and c.Connected then
  1664. pcall(function() c:Disconnect() end)
  1665. end
  1666. end
  1667. pack.conns = {}
  1668. end
  1669.  
  1670. local function ensurePlayerHighlight(plr, char)
  1671. local pack = Module._playerData[plr]
  1672. if not pack or not isValidPlayerCharacter(char) then return end
  1673.  
  1674. if not pack.highlight or not pack.highlight.Parent then
  1675. for _, obj in ipairs(char:GetChildren()) do
  1676. if obj:IsA("Highlight") and obj.Name == "PlayerESP_PreHistoria" then
  1677. pcall(function() obj:Destroy() end)
  1678. end
  1679. end
  1680.  
  1681. local hi = Instance.new("Highlight")
  1682. hi.Name = "PlayerESP_PreHistoria"
  1683. hi.DepthMode = Enum.HighlightDepthMode.AlwaysOnTop
  1684. hi.FillTransparency = ESP_CONFIG.HighlightFillTransparency
  1685. hi.OutlineTransparency = ESP_CONFIG.OutlineTransparency
  1686. hi.Adornee = char
  1687. hi.Parent = char
  1688. pack.highlight = hi
  1689. end
  1690.  
  1691. local col = colorForPlayer(plr)
  1692. pack.highlight.FillColor = col
  1693. pack.highlight.OutlineColor = col
  1694. pack.highlight.Enabled = shouldShowPlayerESP(plr)
  1695. end
  1696.  
  1697. local function ensurePlayerHPGui(plr, char)
  1698. local pack = Module._playerData[plr]
  1699. if not pack or not isValidPlayerCharacter(char) then return end
  1700.  
  1701. local hum = char:FindFirstChildOfClass("Humanoid")
  1702. local head = char:FindFirstChild("Head")
  1703. local root = char:FindFirstChild("HumanoidRootPart")
  1704.  
  1705. if not hum or not root then
  1706. if pack.hpGui then pack.hpGui.Enabled = false end
  1707. return
  1708. end
  1709.  
  1710. pack.hum = hum
  1711. pack.head = head
  1712. pack.root = root
  1713.  
  1714. if not pack.hpGui or not pack.hpGui.Parent then
  1715. for _, obj in ipairs(char:GetChildren()) do
  1716. if obj:IsA("BillboardGui") and obj.Name == "PlayerESP_HP_PreHistoria" then
  1717. pcall(function() obj:Destroy() end)
  1718. end
  1719. end
  1720.  
  1721. local bill = Instance.new("BillboardGui")
  1722. bill.Name = "PlayerESP_HP_PreHistoria"
  1723. bill.AlwaysOnTop = true
  1724. bill.LightInfluence = 0
  1725. bill.Size = ESP_CONFIG.HPBarSize
  1726. bill.MaxDistance = ESP_CONFIG.HPBarMaxDistance
  1727. bill.Parent = char
  1728.  
  1729. local bg = Instance.new("Frame")
  1730. bg.BackgroundColor3 = Color3.fromRGB(25, 25, 25)
  1731. bg.BackgroundTransparency = 0.2
  1732. bg.BorderSizePixel = 0
  1733. bg.Size = UDim2.fromScale(1, 1)
  1734. bg.Parent = bill
  1735.  
  1736. local stroke = Instance.new("UIStroke")
  1737. stroke.Color = Color3.fromRGB(0, 0, 0)
  1738. stroke.Thickness = 1.5
  1739. stroke.Parent = bg
  1740.  
  1741. local corner1 = Instance.new("UICorner")
  1742. corner1.CornerRadius = UDim.new(0, 2)
  1743. corner1.Parent = bg
  1744.  
  1745. local fill = Instance.new("Frame")
  1746. fill.BackgroundColor3 = COLOR_FRIEND
  1747. fill.BorderSizePixel = 0
  1748. fill.Size = UDim2.fromScale(1, 1)
  1749. fill.Parent = bg
  1750.  
  1751. local corner2 = Instance.new("UICorner")
  1752. corner2.CornerRadius = UDim.new(0, 2)
  1753. corner2.Parent = fill
  1754.  
  1755. pack.hpGui = bill
  1756. pack.hpFill = fill
  1757. end
  1758.  
  1759. if head then
  1760. pack.hpGui.Adornee = head
  1761. pack.hpGui.StudsOffset = Vector3.new(0, head.Size.Y/2 + ESP_CONFIG.HPBarYOffset, 0)
  1762. else
  1763. pack.hpGui.Adornee = root
  1764. pack.hpGui.StudsOffset = Vector3.new(0, 2.5 + ESP_CONFIG.HPBarYOffset, 0)
  1765. end
  1766.  
  1767. pack.hpGui.Enabled = shouldShowPlayerHP(plr)
  1768. end
  1769.  
  1770. local function updatePlayerHPBar(plr)
  1771. local pack = Module._playerData[plr]
  1772. if not pack or not pack.hpGui or not pack.hpFill or not pack.hum then return end
  1773.  
  1774. local h = pack.hum.Health
  1775. local m = pack.hum.MaxHealth
  1776. if m <= 0 then m = 100 end
  1777.  
  1778. local ratio = math.clamp(h / m, 0, 1)
  1779. pack.hpFill.Size = UDim2.new(ratio, 0, 1, 0)
  1780.  
  1781. local r, g = 255, 255
  1782. if ratio > 0.5 then
  1783. r = (1 - ratio) * 2 * 255
  1784. else
  1785. g = ratio * 2 * 255
  1786. end
  1787.  
  1788. pack.hpFill.BackgroundColor3 = Color3.fromRGB(r, g, 0)
  1789. pack.hpGui.Enabled = shouldShowPlayerHP(plr) and (h > 0)
  1790. end
  1791.  
  1792. local function setupPlayerESP(plr, char)
  1793. if plr == LocalPlayer or not isValidPlayerCharacter(char) then return end
  1794.  
  1795. local pack = Module._playerData[plr] or {conns = {}}
  1796. Module._playerData[plr] = pack
  1797.  
  1798. if pack.char and pack.char ~= char then
  1799. clearPlayerConns(pack)
  1800. if pack.highlight then pcall(function() pack.highlight:Destroy() end) end
  1801. if pack.hpGui then pcall(function() pack.hpGui:Destroy() end) end
  1802. pack.char = nil
  1803. pack.highlight = nil
  1804. pack.hpGui = nil
  1805. pack.hpFill = nil
  1806. end
  1807.  
  1808. pack.char = char
  1809. local hum = char:FindFirstChildOfClass("Humanoid")
  1810. if not hum then return end
  1811.  
  1812. pack.hum = hum
  1813. hum.HealthDisplayType = Enum.HumanoidHealthDisplayType.AlwaysOff
  1814.  
  1815. task.wait(0.1)
  1816. ensurePlayerHighlight(plr, char)
  1817. ensurePlayerHPGui(plr, char)
  1818. updatePlayerHPBar(plr)
  1819.  
  1820. table.insert(pack.conns, hum.HealthChanged:Connect(function()
  1821. updatePlayerHPBar(plr)
  1822. end))
  1823.  
  1824. table.insert(pack.conns, plr:GetPropertyChangedSignal("Team"):Connect(function()
  1825. task.spawn(function()
  1826. ensurePlayerHighlight(plr, char)
  1827. updatePlayerHPBar(plr)
  1828. end)
  1829. end))
  1830.  
  1831. pack.initialized = true
  1832. end
  1833.  
  1834. function Module.Start()
  1835. -- Processa fila
  1836. task.spawn(function()
  1837. while true do
  1838. task.wait(0.2)
  1839.  
  1840. if #Module._processQueue > 0 and PreHistoriaScript.Config.PlayerESP then
  1841. local plr = table.remove(Module._processQueue, 1)
  1842.  
  1843. if plr and plr.Parent then
  1844. Module._playerData[plr] = {conns = {}}
  1845.  
  1846. if plr.Character then
  1847. task.spawn(function()
  1848. setupPlayerESP(plr, plr.Character)
  1849. end)
  1850. end
  1851.  
  1852. table.insert(Module._playerData[plr].conns, plr.CharacterAdded:Connect(function(char)
  1853. task.wait(0.5)
  1854. setupPlayerESP(plr, char)
  1855. end))
  1856.  
  1857. table.insert(Module._playerData[plr].conns, plr.CharacterRemoving:Connect(function()
  1858. local pack = Module._playerData[plr]
  1859. if pack then
  1860. if pack.hpGui then pcall(function() pack.hpGui:Destroy() end) end
  1861. if pack.highlight then pcall(function() pack.highlight:Destroy() end) end
  1862. pack.initialized = false
  1863. end
  1864. end))
  1865. end
  1866. end
  1867. end
  1868. end)
  1869.  
  1870. -- Monitor players
  1871. task.wait(2)
  1872. Utils.safeConnect(Services.Players.PlayerAdded, function(p)
  1873. task.wait(0.5)
  1874. if p ~= LocalPlayer then
  1875. table.insert(Module._processQueue, p)
  1876. end
  1877. end)
  1878.  
  1879. Utils.safeConnect(Services.Players.PlayerRemoving, function(p)
  1880. if Module._playerData[p] then
  1881. clearPlayerConns(Module._playerData[p])
  1882. if Module._playerData[p].highlight then pcall(function() Module._playerData[p].highlight:Destroy() end) end
  1883. if Module._playerData[p].hpGui then pcall(function() Module._playerData[p].hpGui:Destroy() end) end
  1884. Module._playerData[p] = nil
  1885. end
  1886. end)
  1887.  
  1888. -- Update loop
  1889. task.spawn(function()
  1890. while true do
  1891. task.wait(ESP_CONFIG.UpdateInterval)
  1892.  
  1893. if not PreHistoriaScript.Config.PlayerESP then
  1894. task.wait(1)
  1895. continue
  1896. end
  1897.  
  1898. local processed = 0
  1899. for plr, pack in pairs(Module._playerData) do
  1900. if processed >= ESP_CONFIG.MaxPlayersPerFrame then
  1901. task.wait()
  1902. processed = 0
  1903. end
  1904.  
  1905. if plr and plr.Parent and plr ~= LocalPlayer then
  1906. local char = plr.Character
  1907. if char and isValidPlayerCharacter(char) then
  1908. if not pack.initialized or pack.char ~= char then
  1909. setupPlayerESP(plr, char)
  1910. else
  1911. if pack.highlight then
  1912. pack.highlight.Enabled = shouldShowPlayerESP(plr)
  1913. end
  1914. if pack.hpGui then
  1915. pack.hpGui.Enabled = shouldShowPlayerHP(plr) and pack.hum and pack.hum.Health > 0
  1916. end
  1917. updatePlayerHPBar(plr)
  1918. end
  1919. end
  1920. end
  1921. processed = processed + 1
  1922. end
  1923. end
  1924. end)
  1925. end
  1926.  
  1927. function Module.Reinitialize()
  1928. for plr, _ in pairs(Module._playerData) do
  1929. if Module._playerData[plr] then
  1930. clearPlayerConns(Module._playerData[plr])
  1931. if Module._playerData[plr].highlight then pcall(function() Module._playerData[plr].highlight:Destroy() end) end
  1932. if Module._playerData[plr].hpGui then pcall(function() Module._playerData[plr].hpGui:Destroy() end) end
  1933. end
  1934. end
  1935.  
  1936. Module._playerData = {}
  1937. Module._processQueue = {}
  1938.  
  1939. task.wait(0.1)
  1940.  
  1941. for _, p in ipairs(Services.Players:GetPlayers()) do
  1942. if p ~= LocalPlayer then
  1943. table.insert(Module._processQueue, p)
  1944. end
  1945. end
  1946. end
  1947.  
  1948. function Module.Cleanup()
  1949. for plr, pack in pairs(Module._playerData) do
  1950. clearPlayerConns(pack)
  1951. if pack.highlight then pcall(function() pack.highlight:Destroy() end) end
  1952. if pack.hpGui then pcall(function() pack.hpGui:Destroy() end) end
  1953. end
  1954. Module._playerData = {}
  1955. Module._processQueue = {}
  1956. end
  1957.  
  1958. return Module
  1959. end)()
  1960.  
  1961. --// ========== SISTEMA DE NÍVEL DO DINO (OTIMIZADO) ========== //
  1962. local function getDinoLevelSilent()
  1963. local now = tick()
  1964. local cache = PreHistoriaScript.Cache.DinoLevel
  1965.  
  1966. if (now - cache.lastUpdate) < cache.updateInterval then
  1967. return cache.value
  1968. end
  1969.  
  1970. -- Leaderstats
  1971. local leaderstats = LocalPlayer:FindFirstChild("leaderstats")
  1972. if leaderstats then
  1973. for _, stat in ipairs(leaderstats:GetChildren()) do
  1974. local name = stat.Name:lower()
  1975. if name:find("level") or name:find("lvl") or name:find("nivel") then
  1976. if stat:IsA("IntValue") or stat:IsA("NumberValue") then
  1977. local val = tonumber(stat.Value) or 0
  1978. if val > 0 then
  1979. cache.value = val
  1980. cache.lastUpdate = now
  1981. return val
  1982. end
  1983. end
  1984. end
  1985. end
  1986. end
  1987.  
  1988. -- PlayerGui
  1989. local playerGui = LocalPlayer:FindFirstChild("PlayerGui")
  1990. if playerGui then
  1991. for _, gui in ipairs(playerGui:GetDescendants()) do
  1992. if gui:IsA("TextLabel") or gui:IsA("TextBox") then
  1993. local text = gui.Text:lower()
  1994. if text:find("level") or text:find("lvl") or text:find("nivel") then
  1995. local number = text:match("%d+")
  1996. if number then
  1997. local val = tonumber(number)
  1998. if val and val > 0 and val <= 100 then
  1999. cache.value = val
  2000. cache.lastUpdate = now
  2001. return val
  2002. end
  2003. end
  2004. end
  2005. end
  2006. end
  2007. end
  2008.  
  2009. cache.lastUpdate = now
  2010. return cache.value
  2011. end
  2012.  
  2013. --// ========== SISTEMA DE CRISTAIS (OTIMIZADO) ========== //
  2014. local prioridadeMap = {legendary = 1, epic = 2, rare = 3, bloom = 0, crystal = 4}
  2015.  
  2016. local function getCrystalRank(name)
  2017. name = name:lower()
  2018. for key, rank in pairs(prioridadeMap) do
  2019. if name:find(key) then return rank end
  2020. end
  2021. return 5
  2022. end
  2023.  
  2024. local function getSortedCrystals()
  2025. local found = {}
  2026. for _, obj in ipairs(workspace:GetDescendants()) do
  2027. if obj:IsA("BasePart") and obj.Parent and obj.Parent:IsA("Model") then
  2028. local rank = getCrystalRank(obj.Parent.Name)
  2029. if rank < 5 then
  2030. table.insert(found, {part = obj, rank = rank})
  2031. end
  2032. end
  2033. end
  2034. table.sort(found, function(a, b) return a.rank < b.rank end)
  2035.  
  2036. local parts = {}
  2037. for _, entry in ipairs(found) do
  2038. table.insert(parts, entry.part)
  2039. end
  2040. return parts
  2041. end
  2042.  
  2043. --// ========== SISTEMA DE TELEPORTE SEGURO (OTIMIZADO) ========== //
  2044. local function safeTeleport(targetCFrame, locationName)
  2045. if PreHistoriaScript.Cache.ActiveTeleportConnection then
  2046. PreHistoriaScript.Cache.ActiveTeleportConnection:Disconnect()
  2047. PreHistoriaScript.Cache.ActiveTeleportConnection = nil
  2048. end
  2049.  
  2050. local char = LocalPlayer.Character
  2051. local root = char and char:FindFirstChild("HumanoidRootPart")
  2052. local humanoid = char and char:FindFirstChild("Humanoid")
  2053.  
  2054. if not root or not humanoid then
  2055. if PreHistoriaScript.RayfieldInstance then
  2056. PreHistoriaScript.RayfieldInstance:Notify({
  2057. Title = "❌ Erro",
  2058. Content = "Personagem não encontrado!",
  2059. Duration = 1,
  2060. Image = 4483362458
  2061. })
  2062. end
  2063. return false
  2064. end
  2065.  
  2066. Utils.updateStat("TeleportsUsed", 1)
  2067.  
  2068. root.CFrame = targetCFrame
  2069.  
  2070. task.spawn(function()
  2071. task.wait(0.05)
  2072.  
  2073. local rayParams = RaycastParams.new()
  2074. rayParams.FilterType = Enum.RaycastFilterType.Blacklist
  2075. rayParams.FilterDescendantsInstances = {char}
  2076.  
  2077. local rayResult = workspace:Raycast(root.Position, Vector3.new(0, -100, 0), rayParams)
  2078.  
  2079. if rayResult then
  2080. root.CFrame = CFrame.new(rayResult.Position + Vector3.new(0, 3, 0))
  2081. end
  2082. end)
  2083.  
  2084. return true
  2085. end
  2086.  
  2087. local function teleportTo(cf)
  2088. local root = Utils.getHumanoidRootPart()
  2089. if root and root.Parent then
  2090. root.Parent:SetPrimaryPartCFrame(cf)
  2091. end
  2092. end
  2093.  
  2094. local function teleportToCrystal(c)
  2095. local root = Utils.getHumanoidRootPart()
  2096. if root and c then
  2097. root.Parent:SetPrimaryPartCFrame(CFrame.new(c.Position + Vector3.new(0, 4.5, 0)))
  2098. end
  2099. end
  2100.  
  2101. --// ========== DETECTAR SPAWN ========== //
  2102. task.spawn(function()
  2103. local char = LocalPlayer.Character or LocalPlayer.CharacterAdded:Wait()
  2104. local root = char:WaitForChild("HumanoidRootPart", 10)
  2105.  
  2106. if root then
  2107. task.wait(2)
  2108. PreHistoriaScript.Config.LastSpawnPosition = root.CFrame
  2109. end
  2110.  
  2111. Utils.safeConnect(LocalPlayer.CharacterAdded, function(newChar)
  2112. task.wait(2)
  2113. local newRoot = newChar:FindFirstChild("HumanoidRootPart")
  2114. if newRoot then
  2115. PreHistoriaScript.Config.LastSpawnPosition = newRoot.CFrame
  2116. end
  2117. end)
  2118. end)
  2119.  
  2120. --// ========== CARREGAR TELEPORTS SALVOS ========== //
  2121. local function loadSavedTeleports()
  2122. local success, data = pcall(function()
  2123. return Services.HttpService:JSONDecode(readfile("PreHistoria_Teleports.json"))
  2124. end)
  2125.  
  2126. if success and data then
  2127. PreHistoriaScript.Config.SavedTeleports = data
  2128. print("📍 " .. #data .. " teleports salvos carregados")
  2129. else
  2130. PreHistoriaScript.Config.SavedTeleports = {}
  2131. end
  2132. end
  2133.  
  2134. loadSavedTeleports()
  2135.  
  2136. --// ========== CARREGAR RAYFIELD ========== //
  2137. local Rayfield = loadstring(game:HttpGet('https://sirius.menu/rayfield'))()
  2138. PreHistoriaScript.RayfieldInstance = Rayfield
  2139.  
  2140. --// ========== CRIAR WINDOW ========== //
  2141. local Window = Rayfield:CreateWindow({
  2142. Name = "🦖 Pré-história v" .. PreHistoriaScript.Version .. " - By: NickZScripts",
  2143. Icon = 0,
  2144. LoadingTitle = "Pré-história FIXED",
  2145. LoadingSubtitle = "By: NickZScripts - v" .. PreHistoriaScript.Version,
  2146. Theme = "Default",
  2147. DisableRayfieldPrompts = false,
  2148. DisableBuildWarnings = false,
  2149.  
  2150. ConfigurationSaving = {
  2151. Enabled = true,
  2152. FolderName = nil,
  2153. FileName = "PreHistoria_v5"
  2154. },
  2155.  
  2156. Discord = {
  2157. Enabled = false,
  2158. Invite = "noinvitelink",
  2159. RememberJoins = true
  2160. },
  2161.  
  2162. KeySystem = false,
  2163. })
  2164.  
  2165. PreHistoriaScript.RayfieldWindow = Window
  2166.  
  2167. --// ========== INTERFACE RAYFIELD (RESUMIDA) ========== //
  2168. -- MENU TAB
  2169. local MenuTab = Window:CreateTab("🏠 Menu", 4483362458)
  2170.  
  2171. MenuTab:CreateParagraph({
  2172. Title = "📜 Script Info",
  2173. Content = "Versão: v" .. PreHistoriaScript.Version .. "\nStatus: ✅ Operacional\nOtimizado e Anti-Conflitos"
  2174. })
  2175.  
  2176. local PlayersCountLabel = MenuTab:CreateLabel("👥 Players Online: 0/0")
  2177.  
  2178. local function updatePlayerCount()
  2179. local current = #Services.Players:GetPlayers()
  2180. local max = Services.Players.MaxPlayers
  2181. PlayersCountLabel:Set(string.format("👥 Players Online: %d/%d", current, max))
  2182. end
  2183.  
  2184. updatePlayerCount()
  2185.  
  2186. Utils.safeConnect(Services.Players.PlayerAdded, function() task.wait(0.1) updatePlayerCount() end)
  2187. Utils.safeConnect(Services.Players.PlayerRemoving, function() task.wait(0.1) updatePlayerCount() end)
  2188.  
  2189. local StatsSection = MenuTab:CreateSection("📈 Estatísticas")
  2190.  
  2191. local SessionTimeLabel = MenuTab:CreateLabel("⏱️ Tempo: 00:00:00")
  2192. local DinoLevelLabel = MenuTab:CreateLabel("🦖 Nível: 0/60")
  2193. local CrystalsLabel = MenuTab:CreateLabel("💎 Cristais: 0")
  2194. local TeleportsLabel = MenuTab:CreateLabel("🚀 Teleportes: 0")
  2195.  
  2196. task.spawn(function()
  2197. while true do
  2198. task.wait(2)
  2199. SessionTimeLabel:Set("⏱️ Tempo: " .. Utils.getSessionTime())
  2200. DinoLevelLabel:Set(string.format("🦖 Nível: %d/60", getDinoLevelSilent()))
  2201. CrystalsLabel:Set("💎 Cristais: " .. PreHistoriaScript.Stats.CrystalsCollected)
  2202. TeleportsLabel:Set("🚀 Teleportes: " .. PreHistoriaScript.Stats.TeleportsUsed)
  2203. end
  2204. end)
  2205.  
  2206. -- AUTO FARM TAB
  2207. local AutoFarmTab = Window:CreateTab("⚡ Auto Farm", 4483362458)
  2208.  
  2209. AutoFarmTab:CreateToggle({
  2210. Name = "Auto Farm Cristais",
  2211. CurrentValue = false,
  2212. Flag = "AutoFarm",
  2213. Callback = function(Value)
  2214. PreHistoriaScript.Config.AutoFarm = Value
  2215. end,
  2216. })
  2217.  
  2218. AutoFarmTab:CreateToggle({
  2219. Name = "Auto Coleta",
  2220. CurrentValue = false,
  2221. Flag = "AutoColeta",
  2222. Callback = function(Value)
  2223. PreHistoriaScript.Config.AutoColeta = Value
  2224. end,
  2225. })
  2226.  
  2227. -- ESP TAB
  2228. local EspTab = Window:CreateTab("👁️ ESP", 4483362458)
  2229.  
  2230. EspTab:CreateToggle({
  2231. Name = "ESP de Jogadores",
  2232. CurrentValue = false,
  2233. Flag = "PlayerESP",
  2234. Callback = function(Value)
  2235. PreHistoriaScript.Config.PlayerESP = Value
  2236. if Value then
  2237. PreHistoriaScript.Modules.PlayerESP.Reinitialize()
  2238. end
  2239. end,
  2240. })
  2241.  
  2242. EspTab:CreateToggle({
  2243. Name = "Barra de Vida",
  2244. CurrentValue = false,
  2245. Flag = "PlayerESP_HP",
  2246. Callback = function(Value)
  2247. PreHistoriaScript.Config.PlayerESP_ShowHP = Value
  2248. end,
  2249. })
  2250.  
  2251. EspTab:CreateToggle({
  2252. Name = "ESP de Carnes",
  2253. CurrentValue = false,
  2254. Flag = "MeatESP",
  2255. Callback = function(Value)
  2256. PreHistoriaScript.Config.EspMeatActive = Value
  2257. if Value then
  2258. PreHistoriaScript.Modules.MeatESP.Start()
  2259. else
  2260. PreHistoriaScript.Modules.MeatESP.Stop()
  2261. end
  2262. end,
  2263. })
  2264.  
  2265. -- TELEPORT TAB
  2266. local TeleportTab = Window:CreateTab("🚀 Teleport", 4483362458)
  2267.  
  2268. TeleportTab:CreateButton({
  2269. Name = "Teleportar para Carne",
  2270. Callback = function()
  2271. local meat, _ = PreHistoriaScript.Modules.MeatESP.FindNearestMeat()
  2272. if meat then
  2273. safeTeleport(CFrame.new(meat.Position + Vector3.new(0, 3, 0)), "Carne")
  2274. Utils.updateStat("MeatsCollected", 1)
  2275. end
  2276. end,
  2277. })
  2278.  
  2279. TeleportTab:CreateButton({
  2280. Name = "Voltar ao Spawn",
  2281. Callback = function()
  2282. if PreHistoriaScript.Config.LastSpawnPosition then
  2283. safeTeleport(PreHistoriaScript.Config.LastSpawnPosition, "Spawn")
  2284. end
  2285. end,
  2286. })
  2287.  
  2288. -- SEGURANÇA TAB
  2289. local SecurityTab = Window:CreateTab("🛡️ Segurança", 4483362458)
  2290.  
  2291. SecurityTab:CreateToggle({
  2292. Name = "Admin Detector",
  2293. CurrentValue = PreHistoriaScript.Config.AdminDetector,
  2294. Flag = "AdminDetector",
  2295. Callback = function(Value)
  2296. PreHistoriaScript.Config.AdminDetector = Value
  2297. end,
  2298. })
  2299.  
  2300. SecurityTab:CreateToggle({
  2301. Name = "Anti-Kick & Anti-AFK",
  2302. CurrentValue = PreHistoriaScript.Config.AntiKick,
  2303. Flag = "AntiKick",
  2304. Callback = function(Value)
  2305. PreHistoriaScript.Config.AntiKick = Value
  2306. if Value then
  2307. PreHistoriaScript.Modules.AntiKick.Enable()
  2308. else
  2309. PreHistoriaScript.Modules.AntiKick.Disable()
  2310. end
  2311. end,
  2312. })
  2313.  
  2314. SecurityTab:CreateButton({
  2315. Name = "🌐 Server Hop",
  2316. Callback = function()
  2317. PreHistoriaScript.Modules.ServerHop.HopToLowPopulation()
  2318. end,
  2319. })
  2320.  
  2321. -- COMBAT TAB
  2322. local CombatTab = Window:CreateTab("⚔️ Combat", 4483362458)
  2323.  
  2324. CombatTab:CreateToggle({
  2325. Name = "Hitbox Expander",
  2326. CurrentValue = false,
  2327. Flag = "HitboxExpander",
  2328. Callback = function(Value)
  2329. if Value then
  2330. PreHistoriaScript.Modules.HitboxExpander.Enable()
  2331. else
  2332. PreHistoriaScript.Modules.HitboxExpander.Disable()
  2333. end
  2334. end,
  2335. })
  2336.  
  2337. CombatTab:CreateSlider({
  2338. Name = "Tamanho da Hitbox",
  2339. Range = {5, 50},
  2340. Increment = 1,
  2341. CurrentValue = 20,
  2342. Flag = "HitboxSize",
  2343. Callback = function(Value)
  2344. PreHistoriaScript.Modules.HitboxExpander.SetSize(Value)
  2345. end,
  2346. })
  2347.  
  2348. -- EVENTOS TAB
  2349. local EventsTab = Window:CreateTab("🌸 Eventos", 4483362458)
  2350.  
  2351. EventsTab:CreateToggle({
  2352. Name = "Bloom Crystal Detector",
  2353. CurrentValue = PreHistoriaScript.Config.BloomDetector,
  2354. Flag = "BloomDetector",
  2355. Callback = function(Value)
  2356. PreHistoriaScript.Config.BloomDetector = Value
  2357. if Value then
  2358. PreHistoriaScript.Modules.BloomDetector.Start()
  2359. else
  2360. PreHistoriaScript.Modules.BloomDetector.Stop()
  2361. end
  2362. end,
  2363. })
  2364.  
  2365. -- OTIMIZAÇÃO TAB
  2366. local OptimizationTab = Window:CreateTab("⚡ Otimização", 4483362458)
  2367.  
  2368. OptimizationTab:CreateToggle({
  2369. Name = "FPS Booster",
  2370. CurrentValue = PreHistoriaScript.Config.FPSBooster,
  2371. Flag = "FPSBooster",
  2372. Callback = function(Value)
  2373. if Value then
  2374. PreHistoriaScript.Modules.Optimizer.Enable()
  2375. else
  2376. PreHistoriaScript.Modules.Optimizer.Disable()
  2377. end
  2378. end,
  2379. })
  2380.  
  2381. -- OUTROS TAB
  2382. local OutrosTab = Window:CreateTab("⚙️ Outros", 4483362458)
  2383.  
  2384. OutrosTab:CreateButton({
  2385. Name = "🎯 Abrir Click Teleport",
  2386. Callback = function()
  2387. PreHistoriaScript.Modules.ClickTeleport.Toggle(true)
  2388. end,
  2389. })
  2390.  
  2391. --// ========== AUTO FARM LOOP (OTIMIZADO) ========== //
  2392. task.spawn(function()
  2393. local index = 1
  2394. while true do
  2395. task.wait(PreHistoriaScript.Config.CheckDelay)
  2396.  
  2397. if PreHistoriaScript.Config.AutoFarm then
  2398. local currentLevel = getDinoLevelSilent()
  2399.  
  2400. if currentLevel >= 60 then
  2401. PreHistoriaScript.Config.AutoFarm = false
  2402. print("✅ Nível 60 atingido!")
  2403. else
  2404. local crystals = getSortedCrystals()
  2405. if #crystals > 0 then
  2406. for _, c in ipairs(crystals) do
  2407. if not PreHistoriaScript.Config.AutoFarm or not c or not c.Parent then break end
  2408.  
  2409. teleportToCrystal(c)
  2410. Utils.updateStat("CrystalsCollected", 1)
  2411.  
  2412. local fixarConexao = Utils.safeConnect(Services.RunService.Heartbeat, function()
  2413. if PreHistoriaScript.Config.AutoFarm and c and c:IsDescendantOf(workspace) then
  2414. local char = Utils.getCharacter()
  2415. if char and char.PrimaryPart then
  2416. char:SetPrimaryPartCFrame(CFrame.new(c.Position + Vector3.new(0, 4.5, 0)))
  2417. end
  2418. end
  2419. end)
  2420.  
  2421. local elapsed = 0
  2422. while c:IsDescendantOf(workspace) and elapsed < 12 and PreHistoriaScript.Config.AutoFarm do
  2423. task.wait(PreHistoriaScript.Config.CheckDelay)
  2424. elapsed = elapsed + PreHistoriaScript.Config.CheckDelay
  2425. end
  2426.  
  2427. fixarConexao:Disconnect()
  2428. task.wait(PreHistoriaScript.Config.DelayBetweenCrystals)
  2429. end
  2430. else
  2431. index = (index % #PreHistoriaScript.Config.PatrulhaPontos) + 1
  2432. teleportTo(PreHistoriaScript.Config.PatrulhaPontos[index])
  2433. task.wait(2)
  2434. end
  2435. end
  2436. end
  2437. end
  2438. end)
  2439.  
  2440. --// ========== AUTO COLETA (OTIMIZADO) ========== //
  2441. Utils.safeConnect(Services.RunService.Heartbeat, function()
  2442. if not (PreHistoriaScript.Config.AutoFarm or PreHistoriaScript.Config.AutoColeta) then return end
  2443. if not PreHistoriaScript.Config.podeExecutar then return end
  2444.  
  2445. PreHistoriaScript.Config.podeExecutar = false
  2446.  
  2447. local root = Utils.getHumanoidRootPart()
  2448. if root then
  2449. for _, obj in ipairs(workspace:GetDescendants()) do
  2450. if obj:IsA("ProximityPrompt") and obj.Parent and obj.Parent:IsA("BasePart") then
  2451. if obj.Enabled and (obj.Parent.Position - root.Position).Magnitude <= PreHistoriaScript.Config.raioDeColeta then
  2452. pcall(function()
  2453. fireproximityprompt(obj)
  2454. end)
  2455. end
  2456. end
  2457. end
  2458. end
  2459.  
  2460. task.delay(PreHistoriaScript.Config.delayEntreTentativas, function()
  2461. PreHistoriaScript.Config.podeExecutar = true
  2462. end)
  2463. end)
  2464.  
  2465. --// ========== INICIALIZAÇÃO DE MÓDULOS ========== //
  2466. if PreHistoriaScript.Config.AdminDetector then
  2467. PreHistoriaScript.Modules.AdminDetector.Start()
  2468. end
  2469.  
  2470. if PreHistoriaScript.Config.BloomDetector then
  2471. PreHistoriaScript.Modules.BloomDetector.Start()
  2472. end
  2473.  
  2474. if PreHistoriaScript.Config.AntiKick then
  2475. PreHistoriaScript.Modules.AntiKick.Enable()
  2476. end
  2477.  
  2478. if PreHistoriaScript.Config.FPSBooster then
  2479. PreHistoriaScript.Modules.Optimizer.Enable()
  2480. end
  2481.  
  2482. PreHistoriaScript.Modules.PlayerESP.Start()
  2483. PreHistoriaScript.Modules.AutoUpdate.AutoCheck()
  2484.  
  2485. --// ========== CLEANUP AO SAIR ========== //
  2486. Utils.safeConnect(LocalPlayer.CharacterRemoving, function()
  2487. PreHistoriaScript.Modules.ClickTeleport.Cleanup()
  2488. end)
  2489.  
  2490. Utils.safeConnect(Services.CoreGui.DescendantRemoving, function(obj)
  2491. if obj.Name == "Rayfield" then
  2492. PreHistoriaScript.Cleanup()
  2493. end
  2494. end)
  2495.  
  2496. --// ========== MARCA COMO INICIALIZADO ========== //
  2497. PreHistoriaScript.Initialized = true
  2498.  
  2499. --// ========== LOGS FINAIS ========== //
  2500. print("╔═══════════════════════════════════════════════════════════╗")
  2501. print("║ Pré-história v" .. PreHistoriaScript.Version .. " - OTIMIZADO ║")
  2502. print("╠═══════════════════════════════════════════════════════════╣")
  2503. print("║ ✅ Sistema totalmente encapsulado ║")
  2504. print("║ ✅ Zero conflitos garantido ║")
  2505. print("║ ✅ Performance otimizada ║")
  2506. print("║ ✅ Cleanup robusto implementado ║")
  2507. print("╠═══════════════════════════════════════════════════════════╣")
  2508. print("║ 📌 Versão: " .. PreHistoriaScript.Version .. " ║")
  2509. print("║ 🎮 Jogador: " .. LocalPlayer.Name)
  2510. print("║ 📊 Players: " .. #Services.Players:GetPlayers() .. "/" .. Services.Players.MaxPlayers)
  2511. print("║ 🔗 Namespace: PreHistoriaScript ║")
  2512. print("╠═══════════════════════════════════════════════════════════╣")
  2513. print("║ 🎉 SCRIPT 100% OPERACIONAL! 🎉 ║")
  2514. print("║ Use: getgenv().PreHistoriaScript.Cleanup() para limpar ║")
  2515. print("╚═══════════════════════════════════════════════════════════╝")
  2516.  
  2517. Rayfield:Notify({
  2518. Title = "🦖 Pré-história v" .. PreHistoriaScript.Version,
  2519. Content = "Script carregado com sucesso!\n✅ Otimizado e sem conflitos",
  2520. Duration = 5,
  2521. Image = 4483362458
  2522. })
  2523.  
  2524. --// ========== RETORNA O NAMESPACE ========== //
  2525. return PreHistoriaScript
Advertisement
Add Comment
Please, Sign In to add comment