Advertisement
Flic

REx: Reincarnated

Aug 28th, 2023 (edited)
4,023
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 4.29 KB | None | 0 0
  1. -- Original thread: https://v3rmillion.net/showthread.php?tid=1202877
  2.  
  3. --[[
  4.  
  5. 1. Change the "excludedOres" below for each world to however you like it. I removed most of the useless ores, but you are free to remove more ores or add them back.
  6. 2. If you want to see the ore outline, you can enable it by changing "showBox" to true.
  7. 3. If you have all of your settings and excludedOres ready, hit execute! Enjoy the script!
  8.  
  9. ]]
  10.  
  11. local showBox = false -- Change to true if you want to see ore box outline. Off by default for performance.
  12.  
  13. --[[
  14. Only excludes World 1 ores, you have to modify script yourself if you want to use this for World 2, some ores could be:
  15.  
  16. excludedOres = {"Moon Stone", "Tin", "Moon Mantle", "Jasper", "Aluminum", "Moon Core", "Zinc", "Coal", "Magma", "Copper", "Titanium", "Legacy Uranium", "Lithium", "Nickel", "Quartz", "Gold", "Tourmaline","Jade","Silver","Lapis Lazuli","Bismuth","Nebula","Strontium","Scandium","Platinum","Amethyst","Barrier","Garnet","Cobalt","Emerald","Heliodor","Aquamarine","Topaz","Diamond","Beryllium","Morganite","Ruby","Rocc","Moonrock","nil"}
  17.  
  18. ]]
  19.  
  20. excludedOres = {"Magma", "Stone", "Copper", "Basalt", "Amber", "Diorite", "Coal", "Crystallized Stone", "Nickel", "Bedrock", "Gold", "Granite", "Iron", "Marble", "Etherstone", "Prismatistone","Silver","Obsidian","Ice","Voidstone","Ruby","Celestone","Mantle","Goldstone","Barrier","Quartz","Reflectistone","Emerald"}
  21.  
  22. ----- Don't edit below if you don't know what you're doing -----
  23.  
  24. local folder = game:GetService("Workspace").Mine
  25. local Players = game:GetService("Players")
  26. local LocalPlayer = Players.LocalPlayer
  27. local CoreGui = game:GetService("CoreGui")
  28.  
  29. local function isValidName(name)
  30.     for _, validName in pairs(excludedOres) do
  31.         if name == validName then
  32.             return false
  33.         end
  34.     end
  35.     return true
  36. end
  37.  
  38. local function createESP(primary, distance)
  39.     local player = game:GetService("Players").LocalPlayer
  40.     local rootPart = player.Character.HumanoidRootPart
  41.    
  42.     if showBox then
  43.         local box = Instance.new("BoxHandleAdornment", game.CoreGui)
  44.         box.Adornee = primary
  45.         box.AlwaysOnTop = true
  46.         box.Color = primary.BrickColor
  47.         box.ZIndex = 10
  48.         box.Size = primary.Size + Vector3.new(0.1, 0.1, 0.1)
  49.  
  50.         local function handleRemovedEvent()
  51.             box:Destroy()
  52.             connection:Disconnect()
  53.         end
  54.  
  55.         primary.AncestryChanged:Connect(function()
  56.             if not primary:IsDescendantOf(game.Workspace) then
  57.                 handleRemovedEvent()
  58.             end
  59.         end)
  60.     end
  61.  
  62.     local billboard = Instance.new("BillboardGui", game.CoreGui)
  63.     billboard.Adornee = primary
  64.     billboard.AlwaysOnTop = true
  65.     billboard.Size = UDim2.new(0, 100, 0, 60)
  66.     billboard.StudsOffset = Vector3.new(0, 3, 0)
  67.  
  68.     local nameLabel = Instance.new("TextLabel", billboard)
  69.     nameLabel.BackgroundTransparency = 1
  70.     nameLabel.Size = UDim2.new(1, 0, 0.225, 0)
  71.     nameLabel.Text = primary.Name
  72.     nameLabel.Font = Enum.Font.GothamSemibold
  73.     nameLabel.TextColor3 = primary.Color
  74.     nameLabel.TextScaled = true
  75.    
  76.     local distLabel = Instance.new("TextLabel", billboard)
  77.     distLabel.BackgroundTransparency = 1
  78.     distLabel.Size = UDim2.new(1, 0, 0.175, 0)
  79.     distLabel.Position = UDim2.new(0, 0, 0.225, 0)
  80.     distLabel.Text = "Distance: " .. math.floor(distance)
  81.     distLabel.Font = Enum.Font.GothamSemibold
  82.     distLabel.TextColor3 = primary.Color
  83.     distLabel.TextScaled = true
  84.  
  85.     local connection = game:GetService("RunService").Heartbeat:Connect(function()
  86.         local newDistance = (rootPart.Position - primary.Position).magnitude
  87.         distLabel.Text = "Distance: " .. math.floor(newDistance)
  88.     end)
  89.  
  90.     return {Gui = billboard, Connection = connection, HandleRemovedEvent = handleRemovedEvent}
  91. end
  92.  
  93.  
  94. function isOreExcluded(block)
  95.     if block:IsA("BasePart") and isValidName(block.Name) then
  96.         local distance = (game:GetService("Players").LocalPlayer.Character.HumanoidRootPart.Position - block.Position).magnitude
  97.         createESP(block, distance)
  98.         else
  99.         block.Transparency = 0.3
  100.     end
  101. end
  102.  
  103. for _, part in pairs(folder:GetChildren()) do
  104.     part.Transparency = 0.3
  105.     isOreExcluded(part)
  106. end
  107.  
  108. folder.ChildAdded:Connect(isOreExcluded)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement