Nevzyn

Untitled

Oct 19th, 2025
32
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 19.01 KB | None | 0 0
  1. --// ========== MÓDULO: CLICK TELEPORT (MANTIDO) ========== //
  2.  
  3. local ClickTeleportModule = (function()
  4. local _enabled = false
  5. local _uiVisible = false
  6. local _screenGui = nil
  7. local _mainFrame = nil
  8. local _minimizedBtn = nil
  9. local _connections = {}
  10.  
  11. local Mouse = LocalPlayer:GetMouse()
  12.  
  13. local ClickState = {
  14. StartTime = 0,
  15. StartPosition = nil,
  16. IsValid = false,
  17. }
  18.  
  19. local CTConfig = {
  20. MaxClickTime = 0.3,
  21. MaxDragDistance = 10,
  22. RaycastDistance = 10000,
  23. TeleportOffset = 3,
  24. }
  25.  
  26. local CTTheme = {
  27. Background = Color3.fromRGB(25, 25, 35),
  28. Secondary = Color3.fromRGB(35, 35, 45),
  29. Accent = Color3.fromRGB(90, 170, 255),
  30. Success = Color3.fromRGB(90, 255, 140),
  31. Danger = Color3.fromRGB(255, 90, 90),
  32. Text = Color3.fromRGB(255, 255, 255),
  33. TextDim = Color3.fromRGB(180, 180, 200),
  34. }
  35.  
  36. local function _getMouseHit()
  37. local unitRay = Camera:ScreenPointToRay(Mouse.X, Mouse.Y)
  38.  
  39. local raycastParams = RaycastParams.new()
  40. raycastParams.FilterType = Enum.RaycastFilterType.Blacklist
  41. raycastParams.FilterDescendantsInstances = {LocalPlayer.Character}
  42. raycastParams.IgnoreWater = false
  43.  
  44. local raycastResult = workspace:Raycast(
  45. unitRay.Origin,
  46. unitRay.Direction * CTConfig.RaycastDistance,
  47. raycastParams
  48. )
  49.  
  50. return raycastResult
  51. end
  52.  
  53. local function _teleportToPosition(position)
  54. local root = getHumanoidRootPart()
  55. if not root then return false end
  56.  
  57. local currentPosition = root.Position
  58. local teleportPos = position + Vector3.new(0, CTConfig.TeleportOffset, 0)
  59.  
  60. local directionVector = (position - currentPosition)
  61. local horizontalDirection = Vector3.new(directionVector.X, 0, directionVector.Z)
  62. local lookDirection = horizontalDirection.Unit
  63.  
  64. local targetCFrame = CFrame.new(teleportPos, teleportPos + lookDirection)
  65.  
  66. root.CFrame = targetCFrame
  67.  
  68. updateStat("TeleportsUsed", 1)
  69.  
  70. return true
  71. end
  72.  
  73. local function _isValidClick(startPos, endPos, duration)
  74. if duration > CTConfig.MaxClickTime then return false end
  75.  
  76. local dragDistance = (endPos - startPos).Magnitude
  77. if dragDistance > CTConfig.MaxDragDistance then return false end
  78.  
  79. return true
  80. end
  81.  
  82. local function _updateStatusLabel(text, color)
  83. if _mainFrame then
  84. local statusLabel = _mainFrame:FindFirstChild("Container"):FindFirstChild("StatusLabel")
  85. if statusLabel then
  86. statusLabel.Text = text
  87. statusLabel.TextColor3 = color
  88. end
  89. end
  90. end
  91.  
  92. local function _enableClickDetection()
  93. for _, conn in ipairs(_connections) do
  94. if conn and conn.Connected then
  95. conn:Disconnect()
  96. end
  97. end
  98. _connections = {}
  99.  
  100. table.insert(_connections, UserInputService.InputBegan:Connect(function(input, gameProcessed)
  101. if gameProcessed then return end
  102. if not _enabled then return end
  103.  
  104. if input.UserInputType == Enum.UserInputType.MouseButton1 or
  105. input.UserInputType == Enum.UserInputType.Touch then
  106. ClickState.StartTime = tick()
  107. ClickState.StartPosition = Vector2.new(Mouse.X, Mouse.Y)
  108. ClickState.IsValid = true
  109. end
  110. end))
  111.  
  112. table.insert(_connections, UserInputService.InputEnded:Connect(function(input, gameProcessed)
  113. if gameProcessed then return end
  114. if not _enabled then return end
  115. if not ClickState.IsValid then return end
  116.  
  117. if input.UserInputType == Enum.UserInputType.MouseButton1 or
  118. input.UserInputType == Enum.UserInputType.Touch then
  119.  
  120. local clickDuration = tick() - ClickState.StartTime
  121. local endPosition = Vector2.new(Mouse.X, Mouse.Y)
  122.  
  123. if _isValidClick(ClickState.StartPosition, endPosition, clickDuration) then
  124. local raycastResult = _getMouseHit()
  125.  
  126. if raycastResult then
  127. if _teleportToPosition(raycastResult.Position) then
  128. _updateStatusLabel("✅ Teleportado!", CTTheme.Success)
  129.  
  130. task.wait(1)
  131. _updateStatusLabel("Clique em qualquer lugar para teleportar", CTTheme.TextDim)
  132. end
  133. else
  134. _updateStatusLabel("❌ Não é possível teleportar para o céu", CTTheme.Danger)
  135.  
  136. task.wait(1.5)
  137. _updateStatusLabel("Clique em qualquer lugar para teleportar", CTTheme.TextDim)
  138. end
  139. end
  140.  
  141. ClickState.IsValid = false
  142. end
  143. end))
  144. end
  145.  
  146. local function _disableClickDetection()
  147. for _, conn in ipairs(_connections) do
  148. if conn and conn.Connected then
  149. conn:Disconnect()
  150. end
  151. end
  152. _connections = {}
  153. end
  154.  
  155. local function _minimizeUI()
  156. if _mainFrame then
  157. _mainFrame.Visible = false
  158. end
  159. if _minimizedBtn then
  160. _minimizedBtn.Visible = true
  161.  
  162. _minimizedBtn.Size = UDim2.new(0, 0, 0, 0)
  163. TweenService:Create(_minimizedBtn, TweenInfo.new(0.3, Enum.EasingStyle.Back, Enum.EasingDirection.Out), {
  164. Size = UDim2.new(0, 50, 0, 50)
  165. }):Play()
  166. end
  167. end
  168.  
  169. local function _maximizeUI()
  170. if _minimizedBtn then
  171. TweenService:Create(_minimizedBtn, TweenInfo.new(0.2, Enum.EasingStyle.Back, Enum.EasingDirection.In), {
  172. Size = UDim2.new(0, 0, 0, 0)
  173. }):Play()
  174.  
  175. task.wait(0.2)
  176. _minimizedBtn.Visible = false
  177. end
  178. if _mainFrame then
  179. _mainFrame.Visible = true
  180.  
  181. _mainFrame.Size = UDim2.new(0, 0, 0, 0)
  182. TweenService:Create(_mainFrame, TweenInfo.new(0.3, Enum.EasingStyle.Back, Enum.EasingDirection.Out), {
  183. Size = UDim2.new(0, 260, 0, 180)
  184. }):Play()
  185. end
  186. end
  187.  
  188. local function _createUI()
  189. if _screenGui then
  190. pcall(function() _screenGui:Destroy() end)
  191. _screenGui = nil
  192. end
  193.  
  194. _screenGui = Instance.new("ScreenGui")
  195. _screenGui.Name = "ClickTeleportUI_PreHistoria"
  196. _screenGui.ResetOnSpawn = false
  197. _screenGui.ZIndexBehavior = Enum.ZIndexBehavior.Sibling
  198. _screenGui.Parent = CoreGui
  199.  
  200. _mainFrame = Instance.new("Frame")
  201. _mainFrame.Name = "MainFrame"
  202. _mainFrame.Size = UDim2.new(0, 260, 0, 180)
  203. _mainFrame.Position = UDim2.new(0.5, -130, 0.5, -90)
  204. _mainFrame.BackgroundColor3 = CTTheme.Background
  205. _mainFrame.BackgroundTransparency = 0.05
  206. _mainFrame.BorderSizePixel = 0
  207. _mainFrame.Active = true
  208. _mainFrame.Draggable = true
  209. _mainFrame.Parent = _screenGui
  210.  
  211. local mainCorner = Instance.new("UICorner")
  212. mainCorner.CornerRadius = UDim.new(0, 12)
  213. mainCorner.Parent = _mainFrame
  214.  
  215. local mainStroke = Instance.new("UIStroke")
  216. mainStroke.Color = CTTheme.Accent
  217. mainStroke.Thickness = 2
  218. mainStroke.Transparency = 0.3
  219. mainStroke.Parent = _mainFrame
  220.  
  221. local bgGradient = Instance.new("UIGradient")
  222. bgGradient.Color = ColorSequence.new{
  223. ColorSequenceKeypoint.new(0, Color3.fromRGB(30, 30, 40)),
  224. ColorSequenceKeypoint.new(1, Color3.fromRGB(20, 20, 30))
  225. }
  226. bgGradient.Rotation = 45
  227. bgGradient.Parent = _mainFrame
  228.  
  229. local header = Instance.new("Frame")
  230. header.Size = UDim2.new(1, 0, 0, 50)
  231. header.BackgroundColor3 = CTTheme.Secondary
  232. header.BackgroundTransparency = 0.2
  233. header.BorderSizePixel = 0
  234. header.Parent = _mainFrame
  235.  
  236. local headerCorner = Instance.new("UICorner")
  237. headerCorner.CornerRadius = UDim.new(0, 12)
  238. headerCorner.Parent = header
  239.  
  240. local headerFix = Instance.new("Frame")
  241. headerFix.Size = UDim2.new(1, 0, 0, 12)
  242. headerFix.Position = UDim2.new(0, 0, 1, -12)
  243. headerFix.BackgroundColor3 = CTTheme.Secondary
  244. headerFix.BackgroundTransparency = 0.2
  245. headerFix.BorderSizePixel = 0
  246. headerFix.Parent = header
  247.  
  248. local title = Instance.new("TextLabel")
  249. title.Size = UDim2.new(1, -85, 1, 0)
  250. title.Position = UDim2.new(0, 15, 0, 0)
  251. title.BackgroundTransparency = 1
  252. title.Text = "🎯 Click Teleport"
  253. title.TextColor3 = CTTheme.Text
  254. title.TextSize = 17
  255. title.Font = Enum.Font.GothamBold
  256. title.TextXAlignment = Enum.TextXAlignment.Left
  257. title.Parent = header
  258.  
  259. local minimizeBtn = Instance.new("TextButton")
  260. minimizeBtn.Size = UDim2.new(0, 35, 0, 35)
  261. minimizeBtn.Position = UDim2.new(1, -78, 0.5, -17.5)
  262. minimizeBtn.BackgroundColor3 = Color3.fromRGB(255, 200, 100)
  263. minimizeBtn.BackgroundTransparency = 0.2
  264. minimizeBtn.Text = "➖"
  265. minimizeBtn.TextColor3 = CTTheme.Text
  266. minimizeBtn.TextSize = 18
  267. minimizeBtn.Font = Enum.Font.GothamBold
  268. minimizeBtn.AutoButtonColor = false
  269. minimizeBtn.Parent = header
  270.  
  271. local minimizeCorner = Instance.new("UICorner")
  272. minimizeCorner.CornerRadius = UDim.new(0, 8)
  273. minimizeCorner.Parent = minimizeBtn
  274.  
  275. local closeBtn = Instance.new("TextButton")
  276. closeBtn.Size = UDim2.new(0, 35, 0, 35)
  277. closeBtn.Position = UDim2.new(1, -38, 0.5, -17.5)
  278. closeBtn.BackgroundColor3 = CTTheme.Danger
  279. closeBtn.BackgroundTransparency = 0.2
  280. closeBtn.Text = "✕"
  281. closeBtn.TextColor3 = CTTheme.Text
  282. closeBtn.TextSize = 20
  283. closeBtn.Font = Enum.Font.GothamBold
  284. closeBtn.AutoButtonColor = false
  285. closeBtn.Parent = header
  286.  
  287. local closeCorner = Instance.new("UICorner")
  288. closeCorner.CornerRadius = UDim.new(0, 8)
  289. closeCorner.Parent = closeBtn
  290.  
  291. local container = Instance.new("Frame")
  292. container.Name = "Container"
  293. container.Size = UDim2.new(1, -20, 1, -60)
  294. container.Position = UDim2.new(0, 10, 0, 55)
  295. container.BackgroundTransparency = 1
  296. container.Parent = _mainFrame
  297.  
  298. local toggleBtn = Instance.new("TextButton")
  299. toggleBtn.Name = "ToggleBtn"
  300. toggleBtn.Size = UDim2.new(1, 0, 0, 55)
  301. toggleBtn.Position = UDim2.new(0, 0, 0, 0)
  302. toggleBtn.BackgroundColor3 = CTTheme.Danger
  303. toggleBtn.BackgroundTransparency = 0.1
  304. toggleBtn.Text = "🔴 DESATIVADO"
  305. toggleBtn.TextColor3 = CTTheme.Text
  306. toggleBtn.TextSize = 16
  307. toggleBtn.Font = Enum.Font.GothamBold
  308. toggleBtn.AutoButtonColor = false
  309. toggleBtn.Parent = container
  310.  
  311. local toggleCorner = Instance.new("UICorner")
  312. toggleCorner.CornerRadius = UDim.new(0, 10)
  313. toggleCorner.Parent = toggleBtn
  314.  
  315. local toggleStroke = Instance.new("UIStroke")
  316. toggleStroke.Name = "Stroke"
  317. toggleStroke.Color = CTTheme.Danger
  318. toggleStroke.Thickness = 2
  319. toggleStroke.Transparency = 0.3
  320. toggleStroke.Parent = toggleBtn
  321.  
  322. local statusLabel = Instance.new("TextLabel")
  323. statusLabel.Name = "StatusLabel"
  324. statusLabel.Size = UDim2.new(1, 0, 0, 25)
  325. statusLabel.Position = UDim2.new(0, 0, 0, 65)
  326. statusLabel.BackgroundTransparency = 1
  327. statusLabel.Text = "Clique em qualquer lugar para teleportar"
  328. statusLabel.TextColor3 = CTTheme.TextDim
  329. statusLabel.TextSize = 12
  330. statusLabel.Font = Enum.Font.Gotham
  331. statusLabel.TextWrapped = true
  332. statusLabel.Parent = container
  333.  
  334. local infoLabel = Instance.new("TextLabel")
  335. infoLabel.Size = UDim2.new(1, 0, 0, 20)
  336. infoLabel.Position = UDim2.new(0, 0, 0, 92)
  337. infoLabel.BackgroundTransparency = 1
  338. infoLabel.Text = "⚡ Teleporte limpo e instantâneo"
  339. infoLabel.TextColor3 = CTTheme.Success
  340. infoLabel.TextSize = 11
  341. infoLabel.Font = Enum.Font.Gotham
  342. infoLabel.Parent = container
  343.  
  344. _minimizedBtn = Instance.new("TextButton")
  345. _minimizedBtn.Name = "MinimizedBtn"
  346. _minimizedBtn.Size = UDim2.new(0, 50, 0, 50)
  347. _minimizedBtn.Position = UDim2.new(1, -60, 0, 10)
  348. _minimizedBtn.BackgroundColor3 = CTTheme.Accent
  349. _minimizedBtn.BackgroundTransparency = 0.1
  350. _minimizedBtn.Text = "🎯"
  351. _minimizedBtn.TextColor3 = CTTheme.Text
  352. _minimizedBtn.TextSize = 24
  353. _minimizedBtn.Font = Enum.Font.GothamBold
  354. _minimizedBtn.AutoButtonColor = false
  355. _minimizedBtn.Visible = false
  356. _minimizedBtn.Active = true
  357. _minimizedBtn.Draggable = true
  358. _minimizedBtn.Parent = _screenGui
  359.  
  360. local minimizedCorner = Instance.new("UICorner")
  361. minimizedCorner.CornerRadius = UDim.new(0, 12)
  362. minimizedCorner.Parent = _minimizedBtn
  363.  
  364. local minimizedStroke = Instance.new("UIStroke")
  365. minimizedStroke.Color = CTTheme.Accent
  366. minimizedStroke.Thickness = 2
  367. minimizedStroke.Parent = _minimizedBtn
  368.  
  369. local minimizedGradient = Instance.new("UIGradient")
  370. minimizedGradient.Color = ColorSequence.new{
  371. ColorSequenceKeypoint.new(0, Color3.fromRGB(100, 180, 255)),
  372. ColorSequenceKeypoint.new(1, Color3.fromRGB(70, 140, 255))
  373. }
  374. minimizedGradient.Rotation = 90
  375. minimizedGradient.Parent = _minimizedBtn
  376.  
  377. toggleBtn.MouseButton1Click:Connect(function()
  378. _enabled = not _enabled
  379.  
  380. if _enabled then
  381. toggleBtn.Text = "🟢 ATIVADO"
  382. toggleBtn.BackgroundColor3 = CTTheme.Success
  383. toggleStroke.Color = CTTheme.Success
  384. statusLabel.Text = "Clique em qualquer lugar para teleportar"
  385. _enableClickDetection()
  386. else
  387. toggleBtn.Text = "🔴 DESATIVADO"
  388. toggleBtn.BackgroundColor3 = CTTheme.Danger
  389. toggleStroke.Color = CTTheme.Danger
  390. statusLabel.Text = "Teleporte desativado"
  391. _disableClickDetection()
  392. end
  393. end)
  394.  
  395. minimizeBtn.MouseButton1Click:Connect(function()
  396. _minimizeUI()
  397. end)
  398.  
  399. _minimizedBtn.MouseButton1Click:Connect(function()
  400. _maximizeUI()
  401. end)
  402.  
  403. closeBtn.MouseButton1Click:Connect(function()
  404. _enabled = false
  405. _disableClickDetection()
  406.  
  407. if _screenGui then
  408. pcall(function() _screenGui:Destroy() end)
  409. _screenGui = nil
  410. _mainFrame = nil
  411. _minimizedBtn = nil
  412. end
  413.  
  414. _uiVisible = false
  415. Config.ClickTeleportEnabled = false
  416.  
  417. Rayfield:Notify({
  418. Title = "🎯 Click Teleport",
  419. Content = "Desativado completamente",
  420. Duration = 1,
  421. Image = 4483362458
  422. })
  423. end)
  424.  
  425. local function addHoverEffect(button, normalTrans)
  426. button.MouseEnter:Connect(function()
  427. TweenService:Create(button, TweenInfo.new(0.2), {
  428. BackgroundTransparency = 0
  429. }):Play()
  430. end)
  431.  
  432. button.MouseLeave:Connect(function()
  433. TweenService:Create(button, TweenInfo.new(0.2), {
  434. BackgroundTransparency = normalTrans or 0.1
  435. }):Play()
  436. end)
  437. end
  438.  
  439. addHoverEffect(toggleBtn, 0.1)
  440. addHoverEffect(minimizeBtn, 0.2)
  441. addHoverEffect(closeBtn, 0.2)
  442. addHoverEffect(_minimizedBtn, 0.1)
  443.  
  444. _uiVisible = true
  445. end
  446.  
  447. return {
  448. Init = function()
  449. print("✅ Módulo Click Teleport inicializado")
  450. end,
  451.  
  452. Toggle = function(state)
  453. Config.ClickTeleportEnabled = state
  454.  
  455. if state then
  456. if not _uiVisible then
  457. _createUI()
  458.  
  459. Rayfield:Notify({
  460. Title = "🎯 Click Teleport",
  461. Content = "Interface aberta!",
  462. Duration = 1,
  463. Image = 4483362458
  464. })
  465. end
  466. else
  467. if _screenGui then
  468. _enabled = false
  469. _disableClickDetection()
  470.  
  471. pcall(function() _screenGui:Destroy() end)
  472. _screenGui = nil
  473. _mainFrame = nil
  474. _minimizedBtn = nil
  475. end
  476.  
  477. _uiVisible = false
  478.  
  479. Rayfield:Notify({
  480. Title = "🎯 Click Teleport",
  481. Content = "Desativado",
  482. Duration = 1,
  483. Image = 4483362458
  484. })
  485. end
  486. end,
  487.  
  488. Cleanup = function()
  489. _enabled = false
  490. _disableClickDetection()
  491.  
  492. if _screenGui then
  493. pcall(function() _screenGui:Destroy() end)
  494. _screenGui = nil
  495. _mainFrame = nil
  496. _minimizedBtn = nil
  497. end
  498.  
  499. _uiVisible = false
  500. print("🧹 Click Teleport limpo")
  501. end,
  502.  
  503. IsEnabled = function()
  504. return Config.ClickTeleportEnabled
  505. end
  506. }
  507. end)()
  508.  
  509. ClickTeleportModule.Init()
  510.  
  511. --// ========== SISTEMA DE NÍVEL DO DINO (MANTIDO) ========== //
  512.  
  513. local function getDinoLevelSilent()
  514. local now = tick()
  515. if (now - DinoLevelCache.lastUpdate) < DinoLevelCache.updateInterval then
  516. return DinoLevelCache.value
  517. end
  518.  
  519. local leaderstats = LocalPlayer:FindFirstChild("leaderstats")
  520. if leaderstats then
  521. for _, stat in ipairs(leaderstats:GetChildren()) do
  522. local name = stat.Name:lower()
  523. if name:find("level") or name:find("lvl") or name:find("nivel") then
  524. if stat:IsA("IntValue") or stat:IsA("NumberValue") then
  525. local val = tonumber(stat.Value) or 0
  526. if val > 0 then
  527. DinoLevelCache.value = val
  528. DinoLevelCache.lastUpdate = now
  529. return val
  530. end
  531. end
  532. end
  533. end
  534. end
  535.  
  536. local playerGui = LocalPlayer:FindFirstChild("PlayerGui")
  537. if playerGui then
  538. for _, gui in ipairs(playerGui:GetDescendants()) do
  539. if gui:IsA("TextLabel") or gui:IsA("TextBox") then
  540. local text = gui.Text:lower()
  541.  
  542. if text:find("level") or text:find("lvl") or text:find("nivel") then
  543. local number = text:match("%d+")
  544. if number then
  545. local val = tonumber(number)
  546. if val and val > 0 and val <= 100 then
  547. DinoLevelCache.value = val
  548. DinoLevelCache.lastUpdate = now
  549. return val
  550. end
  551. end
  552. end
  553. end
  554.  
  555. if gui:IsA("IntValue") or gui:IsA("NumberValue") then
  556. local name = gui.Name:lower()
  557. if name:find("level") or name:find("lvl") or name:find("nivel") then
  558. local val = tonumber(gui.Value) or 0
  559. if val > 0 then
  560. DinoLevelCache.value = val
  561. DinoLevelCache.lastUpdate = now
  562. return val
  563. end
  564. end
  565. end
  566. end
  567. end
  568.  
  569. local char = LocalPlayer.Character
  570. if char then
  571. for _, obj in ipairs(char:GetDescendants()) do
  572. if obj:IsA("IntValue") or obj:IsA("NumberValue") then
  573. local name = obj.Name:lower()
  574. if name:find("level") or name:find("lvl") or name:find("nivel") then
  575. local val = tonumber(obj.Value) or 0
  576. if val > 0 then
  577. DinoLevelCache.value = val
  578. DinoLevelCache.lastUpdate = now
  579. return val
  580. end
  581. end
  582. end
  583. end
  584. end
  585.  
  586. local possibleFolders = {
  587. workspace:FindFirstChild("Dinosaurs"),
  588. workspace:FindFirstChild("Pets"),
  589. workspace:FindFirstChild("NPCs"),
  590. workspace:FindFirstChild("Creatures"),
  591. workspace:FindFirstChild("Animals")
  592. }
  593.  
  594. for _, folder in ipairs(possibleFolders) do
  595. if folder then
  596. for _, dino in ipairs(folder:GetChildren()) do
  597. local owner = dino:FindFirstChild("Owner") or dino:FindFirstChild("Player")
  598.  
  599. if owner and owner:IsA("ObjectValue") and owner.Value == LocalPlayer then
  600. for _, obj in ipairs(dino:GetDescendants()) do
  601. if obj:IsA("IntValue") or obj:IsA("NumberValue") or obj:IsA("StringValue") then
  602. local name = obj.Name:lower()
  603. if name:find("level") or name:find("lvl") or name:find("nivel") then
  604. local val = tonumber(obj.Value) or 0
  605. if val > 0 then
  606. DinoLevelCache.value = val
  607. DinoLevelCache.lastUpdate = now
  608. return val
  609. end
  610. end
  611. end
  612. end
  613. end
  614. end
  615. end
  616. end
  617.  
  618. DinoLevelCache.lastUpdate = now
  619. return DinoLevelCache.value
  620. end
  621.  
  622. --// ========== SISTEMA DE CRISTAIS (MANTIDO) ========== //
  623.  
  624. local prioridadeMap = { legendary = 1, epic = 2, rare = 3, bloom = 0, crystal = 4 }
  625.  
  626. local function getCrystalRank(name)
  627. name = name:lower()
  628. for key, rank in pairs(prioridadeMap) do
  629. if name:find(key) then return rank end
  630. end
  631. return 5
  632. end
  633.  
  634. local function getSortedCrystals()
  635. local found = {}
  636. for _, obj in ipairs(workspace:GetDescendants()) do
  637. if obj:IsA("BasePart") and obj.Parent and obj.Parent:IsA("Model") then
  638. local rank = getCrystalRank(obj.Parent.Name)
  639. if rank < 5 then
  640. table.insert(found, {part = obj, rank = rank})
  641. end
  642. end
  643. end
  644. table.sort(found, function(a, b) return a.rank < b.rank end)
  645. local parts = {}
  646. for _, entry in ipairs(found) do
  647. table.insert(parts, entry.part)
  648. if entry.rank == 0 then -- Bloom crystal
  649. updateStat("CrystalsCollected", 1)
  650. end
  651. end
  652. return parts
  653. end
  654.  
  655. --// ========== [CONTINUA NA PARTE 3 COM ESP, UI E LOOPS] ========== //
Advertisement
Add Comment
Please, Sign In to add comment