Advertisement
ghostkiller967

BCW Script

May 17th, 2022
775
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.  
  2. --[[ READ THIS BEFORE EXECUTING:
  3. 1. The settings save so if you have the biome farmer enabled when you leave and when you join again you will leave the game if the current biome or boss is blacklsited or isn't whitelisted.
  4. 2. The biome farmer isn't perfect, you might get the normal biome and stay in the game until the biome finishes.
  5.     You might want to check from time to time if the biome is the same for a long time or have a lot of mobs around you, if this happens then just leave the game.
  6.  
  7. ]]
  8.  
  9. -- Default Settings --  
  10. local OreESPColor = Color3.fromRGB(255,255,255)
  11. local OreESPFixedESPSize = true
  12. local OreESPEnabled = false
  13. local OreESPTargets = {"All"}
  14.  
  15. local FullbrightEnabled = false
  16. local FullbrightAmbientColor = Color3.fromRGB(178, 178, 178)
  17.  
  18. local BiomeFarmEnabled = false
  19. local BiomeFarmBlacklist = true
  20. local BiomeFarmSelectedBiomes = {"Moon", "Blizzard", "Nature", "Flames", "Stormsurge", "Radiation"}
  21. local BiomeFarmSelectedBosses = {"Unknown Machine", "Archmage", "The Fallen", "Steve", "The Ripper", "The Paladin", "The Controller"}
  22.  
  23. local SaveFolder = "BCW Overhaul"
  24. ----------------------
  25.  
  26. --[[
  27.     Credits to Stebulous for the Solaris UI Library
  28.  
  29.     Source: https://github.com/Stebulous/solaris-ui-lib/blob/main/source.lua
  30.     Example: https://github.com/bloodball/UI-Librarys/blob/main/SolarisLib
  31. ]]
  32.  
  33. local SolarisLib = loadstring(game:HttpGet("https://pastebin.com/raw/5C8kg3Pg"))()
  34. local http = game:GetService("HttpService")
  35.  
  36. function set(list)
  37.     local set = {}
  38.     for _, l in ipairs(list) do set[l] = true end
  39.     return set
  40. end
  41.  
  42. function AddUI(part, color, fixed)
  43.     local partGui = Instance.new("BillboardGui", part)
  44.     if fixed then
  45.         partGui.Size = UDim2.new(0,10,0,10)
  46.     else
  47.         partGui.Size = UDim2.new(1,0,1,0)
  48.     end
  49.     partGui.AlwaysOnTop = true
  50.     partGui.Name = "Ore-ESP"
  51.    
  52.     local frame = Instance.new("Frame", partGui)
  53.     frame.BackgroundColor3 = color
  54.     frame.BackgroundTransparency = 0.75
  55.     frame.Size = UDim2.new(1,0,1,0)
  56.     frame.BorderSizePixel = 0
  57.    
  58.     local nameGui = Instance.new("BillboardGui", part)
  59.     if fixed then
  60.         nameGui.Size = UDim2.new(0,50,0,25)
  61.     else
  62.         nameGui.Size = UDim2.new(5,0,2.5,0)
  63.     end
  64.     nameGui.SizeOffset = Vector2.new(0,1)
  65.     nameGui.AlwaysOnTop = true
  66.     nameGui.Name = "Name"
  67.    
  68.     local text = Instance.new("TextLabel", nameGui)
  69.     text.Text = part.Parent.Name
  70.     text.TextColor3 = color
  71.     text.TextTransparency = 0.25
  72.     text.BackgroundTransparency = 1
  73.     text.TextScaled = true
  74.     text.Size = UDim2.new(1,0,1,0)
  75.     text.Font = Enum.Font.GothamSemibold
  76.     text.Name = "Text"
  77. end
  78.  
  79. function split(inputstr, sep)
  80.     if sep == nil then
  81.         sep = "%s"
  82.     end
  83.     local t = {}
  84.     for str in string.gmatch(inputstr, "([^"..sep.."]+)") do
  85.         table.insert(t, str)
  86.     end
  87.     return t
  88. end
  89.  
  90. function indexOf(array, value)
  91.     for i, v in ipairs(array) do
  92.         if v == value then
  93.             return i
  94.         end
  95.     end
  96.     return nil
  97. end
  98.  
  99. function SaveCfg(folder, cfg)
  100.     local content = {}
  101.     for i,v in pairs(SolarisLib.Flags) do
  102.         content[i] = v.Value
  103.     end
  104.     writefile(folder.."/configs/"..cfg..".json", tostring(http:JSONEncode(content)))
  105. end
  106.  
  107. function LoadCfg(folder, cfg)
  108.     local content = http:JSONDecode(readfile(folder.."/configs/"..cfg..".json"))
  109.     table.foreach(content, function(key,value)
  110.         if SolarisLib.Flags[key] then
  111.             SolarisLib.Flags[key]:Set(value)
  112.         else
  113.             warn("cfg loader - could not find", key, value)
  114.         end
  115.     end)
  116. end
  117.  
  118. local player = game.Players.LocalPlayer
  119. local isInCaves = game:GetService("Workspace"):FindFirstChild("Map") ~= nil
  120. local isInMainGame = game:GetService("Workspace"):FindFirstChild("Landscape") ~= nil
  121.  
  122. local bosses = {
  123.     "Unknown Machine",
  124.     "Archmage",
  125.     "The Fallen",
  126.     "Steve",
  127.     "The Ripper",
  128.     "The Paladin",
  129.     "The Controller",
  130.     "Rain"
  131. }
  132.  
  133. --[[
  134.     Normal:
  135.         BrickColor: Cyan
  136.         SoundId: 9063887851
  137.     Moon:
  138.         BrickColor: Electric blue
  139.         SoundId: 9063887851
  140.     Flames:
  141.         BrickColor: Neon orange
  142.         SoundId: 9064299636
  143.     Blizzard:
  144.         BrickColor: Pastel light blue
  145.         SoundId: 9064161163
  146.     Stormsurge:
  147.         BrickColor: Electric blue
  148.         SoundId: 9064286633
  149.     Radiation:
  150.         BrickColor: Really black
  151.         SoundId: 9583751773
  152.     PvC:
  153.         BrickColor: Bright violet
  154.         SoundId: 9200994158
  155.     HvUh:
  156.         BrickColor: Crimson
  157.         SoundId: 9200994158
  158. ]]
  159.  
  160. local biomes = {
  161.     ["9063887851"] = {
  162.         ["Cyan"] = "Normal",
  163.         ["Electric blue"] = "Moon"
  164.     },
  165.     ["9064161163"] = {
  166.         ["Pastel light blue"] = "Blizzard"
  167.     },
  168.     ["9064299636"] = {
  169.         ["Neon orange"] = "Flames"
  170.     },
  171.     ["9064101181"] = {
  172.         ["Electric blue"] = "Nature"
  173.     },
  174.     ["9064286633"] = {
  175.         ["Electric blue"] = "Stormsurge"
  176.     },
  177.     ["9583751773"] = {
  178.         ["Really black"] = "Radiation"
  179.     },
  180.     ["9200994158"] = {
  181.         ["Bright violet"] = "PvC",
  182.         ["Crimson"] = "HvUh"
  183.     }
  184. }
  185.  
  186. repeat
  187.     wait()
  188. until game:GetService("Workspace"):FindFirstChild("backgroundmusic") ~= nil and game:GetService("Workspace"):FindFirstChild("Landscape") ~= nil and game:GetService("Workspace"):FindFirstChild("Landscape"):FindFirstChild("Water") ~= nil
  189.  
  190. local currentBiome = biomes[split(game:GetService("Workspace").backgroundmusic.SoundId, "=")[2]][tostring(game:GetService("Workspace").Landscape.Water.BrickColor)]
  191. local biomeNames = {}
  192. for _,v1 in pairs(biomes) do
  193.     for _,v2 in pairs(v1) do
  194.         table.insert(biomeNames, v2)
  195.     end
  196. end
  197.  
  198. local _OreESPTargets = set(OreESPTargets)
  199. local _BiomeFarmSelectedBiomes = set(BiomeFarmSelectedBiomes)
  200. local _BiomeFarmSelectedBosses = set(BiomeFarmSelectedBosses)
  201.  
  202. -- The default light settings to revert to when you toggle the fullbright
  203. local NormalLightingSettings = {
  204.     Brightness = game:GetService("Lighting").Brightness,
  205.     ClockTime = game:GetService("Lighting").ClockTime,
  206.     FogEnd = game:GetService("Lighting").FogEnd,
  207.     GlobalShadows = game:GetService("Lighting").GlobalShadows,
  208.     Ambient = game:GetService("Lighting").Ambient
  209. }
  210.  
  211. local win = SolarisLib:New({
  212.     Name = "Balanced Craftwars Overhaul",
  213.     FolderToSave = SaveFolder,
  214. })
  215.  
  216. local visuals = win:Tab("Visuals")
  217. local fullbright = visuals:Section("Fullbright")
  218.  
  219. game:GetService("Workspace").ChildAdded:Connect(function(child)
  220.     if child.Name == "backgroundmusic" then -- backgroundmusic gets readded to the workspace when the biome changes
  221.         wait(5) -- wait for the biome to load entirely just to be sure
  222.         local id = split(child.SoundId, "=")[2] -- get the song that is playing during the biome
  223.         local color = tostring(game:GetService("Workspace").Landscape.Water.BrickColor) -- get the color of the water
  224.         print(id, color)
  225.         if biomes[id] ~= nil then -- not all biomes are in the biomes list, if its not in there then just don't leave
  226.             if biomes[id][color] ~= nil then
  227.                 currentBiome = biomes[id][color]
  228.                 print("Biome switched to: "..currentBiome)
  229.                 if BiomeFarmEnabled then
  230.                     if BiomeFarmBlacklist then
  231.                         if _BiomeFarmSelectedBiomes[currentBiome] then
  232.                             game:Shutdown() -- leave if the biome is blacklisted
  233.                         end
  234.                     else
  235.                         if not _BiomeFarmSelectedBiomes[currentBiome] then
  236.                             game:Shutdown() -- leave if the biome is not whitelisted
  237.                         end
  238.                     end
  239.                 end
  240.             end
  241.         end
  242.     else
  243.         if BiomeFarmEnabled then
  244.             if BiomeFarmBlacklist then
  245.                 if _BiomeFarmSelectedBosses[child.Name] then
  246.                     game:Shutdown() -- leave the game is the spawned boss is blacklisted
  247.                 end
  248.             else
  249.                 if not _BiomeFarmSelectedBosses[child.Name] then
  250.                     game:Shutdown() -- leave the game is the spawned boss is not whitelisted
  251.                 end
  252.             end
  253.         end
  254.     end
  255. end)
  256.  
  257. -- When player leaves, save the settings
  258. game.Players.PlayerRemoving:Connect(function(plr)
  259.     if plr == player then
  260.         SaveCfg(SaveFolder, "settings")
  261.     end
  262. end)
  263.  
  264. -- Tells the player how to toggle the UI
  265. SolarisLib:Notification("Information", "To toggle the UI, press " .. SolarisLib.Settings["CloseBind"])
  266.  
  267. -- If the player is in caves, add the Ore ESP
  268. if isInCaves then
  269.     game:GetService("Workspace").Map.Ores.ChildAdded:Connect(function(v)
  270.         if OreESPEnabled then
  271.             local rock = v:WaitForChild("Rock")
  272.             if _OreESPTargets["All"] or _OreESPTargets[rock.Parent.name] then
  273.                 AddUI(rock, OreESPColor, OreESPFixedESPSize)
  274.             end
  275.         end
  276.     end)
  277.  
  278.     local oreESP = visuals:Section("Ore ESP")
  279.  
  280.     oreESP:Toggle("Enabled", OreESPEnabled, "OreESPEnabled", function(t)
  281.         OreESPEnabled = t
  282.         if OreESPEnabled then
  283.             print("Ore ESP Enabled")
  284.             for _,v in pairs(game:GetService("Workspace").Map.Ores:GetChildren()) do
  285.                 if _OreESPTargets["All"] or _OreESPTargets[v.Rock.Parent.name] then
  286.                     AddUI(v.Rock, OreESPColor, OreESPFixedESPSize)
  287.                 end
  288.             end
  289.         else
  290.             print("Ore ESP Disabled")
  291.             for _,v in pairs(game:GetService("Workspace").Map.Ores:GetChildren()) do
  292.                 v.Rock:ClearAllChildren()
  293.             end
  294.         end
  295.     end)
  296.  
  297.     oreESP:Toggle("Fixed ESP Size", OreESPFixedESPSize, "OreFixedESPSize", function(t)
  298.         OreESPFixedESPSize = t
  299.         if OreESPFixedESPSize then
  300.             print("Ore ESP Fixed Size Disabled")
  301.         else
  302.             print("Ore ESP Fixed Size Disabled")
  303.         end
  304.         if OreESPEnabled then
  305.             for _,v in pairs(game:GetService("Workspace").Map.Ores:GetChildren()) do
  306.                 v.Rock:ClearAllChildren()
  307.                 if _OreESPTargets["All"] or _OreESPTargets[v.Rock.Parent.name] then
  308.                     AddUI(v.Rock, OreESPColor, OreESPFixedESPSize)
  309.                 end
  310.             end
  311.         end
  312.     end)
  313.  
  314.     oreESP:MultiDropdown("Ore Targets", {    
  315.         "All",
  316.         "Iron",
  317.         "Lead",
  318.         "Gold",
  319.         "Diamond",
  320.         "Crystal",
  321.         "Cobalt",
  322.         "Oureclasium",
  323.         "Viridis",
  324.         "Tungsten",
  325.         "Titanium",
  326.         "Mithril",
  327.         "Adamantine",
  328.         "Titanstone",
  329.         "Plutonium",
  330.         "Irradium",
  331.         "Gemstone of Purity",
  332.         "Gemstone of Hatred",
  333.         "Purite",
  334.         "Hatrite",
  335.         "Hevenite",
  336.         "Hellite",
  337.         "Moonstone",
  338.         "Forbidden Crystal"
  339.     }, OreESPTargets, "OreTargets", function(t)
  340.         OreESPTargets = t
  341.         _OreESPTargets = set(OreESPTargets)
  342.         if OreESPEnabled then
  343.             for _,v in pairs(game:GetService("Workspace").Map.Ores:GetChildren()) do
  344.                 v.Rock:ClearAllChildren()
  345.                 if _OreESPTargets["All"] or _OreESPTargets[v.Rock.Parent.name] then
  346.                     AddUI(v.Rock, OreESPColor, OreESPFixedESPSize)
  347.                 end
  348.             end
  349.         end
  350.     end)
  351.  
  352.     oreESP:Colorpicker("ESP Color", OreESPColor, "ESPColor", function(t)
  353.         OreESPColor = t
  354.         if OreESPEnabled then
  355.             for _,v in pairs(game:GetService("Workspace").Map.Ores:GetChildren()) do
  356.                 v.Rock:ClearAllChildren()
  357.                 if _OreESPTargets["All"] or _OreESPTargets[v.Rock.Parent.name] then
  358.                     AddUI(v.Rock, OreESPColor, OreESPFixedESPSize)
  359.                 end
  360.             end
  361.         end
  362.     end)
  363. end
  364.  
  365. -- If the player is in the main game, add the Biome Farm
  366. if isInMainGame then
  367.     local biomefarmTab = win:Tab("Biome Farm")
  368.     local biomefarm = biomefarmTab:Section("Biome Farm")
  369.  
  370.     biomefarm:Toggle("Enabled", BiomeFarmEnabled, "BiomeFarmEnabled", function(t)
  371.         BiomeFarmEnabled = t
  372.     end)
  373.    
  374.     biomefarm:Dropdown("Blacklist", {"Blacklist", "Whitelist"}, (BiomeFarmBlacklist and "Blacklist" or "Whitelist"), "BiomeFarmBlacklist", function(t)
  375.         BiomeFarmBlacklist = t == "Blacklist"
  376.     end)
  377.    
  378.     biomefarm:MultiDropdown("Selected Biomes", biomeNames, BiomeFarmSelectedBiomes, "BiomeFarmBiomes", function(t)
  379.         BiomeFarmSelectedBiomes = t
  380.         _BiomeFarmSelectedBiomes = set(BiomeFarmSelectedBiomes)
  381.     end)
  382.    
  383.     biomefarm:MultiDropdown("Selected Bosses", bosses, BiomeFarmSelectedBosses, "BiomeFarmBosses", function(t)
  384.         BiomeFarmSelectedBosses = t
  385.         _BiomeFarmSelectedBosses = set(t)
  386.     end)
  387. end
  388.  
  389. -- General hack
  390. fullbright:Toggle("Enabled", FullbrightEnabled, "FullbrightEnabled", function(t)
  391.     FullbrightEnabled = t
  392.     if FullbrightEnabled then
  393.         game:GetService("Lighting").Brightness = 1
  394.         game:GetService("Lighting").ClockTime = 12
  395.         game:GetService("Lighting").FogEnd = 786543
  396.         game:GetService("Lighting").GlobalShadows = false
  397.         game:GetService("Lighting").Ambient = FullbrightAmbientColor
  398.     else
  399.         game:GetService("Lighting").Brightness = NormalLightingSettings.Brightness
  400.         game:GetService("Lighting").ClockTime = NormalLightingSettings.ClockTime
  401.         game:GetService("Lighting").FogEnd = NormalLightingSettings.FogEnd
  402.         game:GetService("Lighting").GlobalShadows = NormalLightingSettings.GlobalShadows
  403.         game:GetService("Lighting").Ambient = NormalLightingSettings.Ambient
  404.     end
  405. end)
  406.  
  407. fullbright:Colorpicker("Ambient Color", FullbrightAmbientColor, "FullbrightAmbientColor", function(t)
  408.     FullbrightAmbientColor = t
  409.     if FullbrightEnabled then
  410.         game:GetService("Lighting").Ambient = FullbrightAmbientColor
  411.     end
  412. end)
  413.  
  414. LoadCfg(SaveFolder, "settings")
  415.  
  416. -- automatically leaves the game if the current biome or boss is blacklisted or is not whitelisted
  417. if BiomeFarmEnabled and isInMainGame then
  418.     local boss = ""
  419.     for _,child in pairs(game:GetService("Workspace"):GetChildren()) do
  420.         if bosses[child.Name] then
  421.             boss = child.Name
  422.             print("Current boss: " .. boss)
  423.         end
  424.     end
  425.     if BiomeFarmBlacklist then
  426.         if _BiomeFarmSelectedBosses[boss] then
  427.             game:Shutdown() -- leave if the current boss is blacklisted
  428.         end
  429.     else
  430.         if not _BiomeFarmSelectedBosses[boss] then
  431.             game:Shutdown() -- leave if the current boss is not whitelisted
  432.         end
  433.     end
  434.     local id = split(game:GetService("Workspace").backgroundmusic.SoundId, "=")[2]
  435.     local color = tostring(game:GetService("Workspace").Landscape.Water.BrickColor)
  436.     if biomes[id] ~= nil then
  437.         if biomes[id][color] ~= nil then
  438.             currentBiome = biomes[id][color]
  439.             print("Current biome: "..currentBiome)
  440.             if BiomeFarmEnabled then
  441.                 if BiomeFarmBlacklist then
  442.                     if _BiomeFarmSelectedBiomes[currentBiome] then
  443.                         game:Shutdown() -- leave if the current biome is blacklisted
  444.                     end
  445.                 else
  446.                     if not _BiomeFarmSelectedBiomes[currentBiome] then
  447.                         game:Shutdown() -- leave if the current biome is not whitelisted
  448.                     end
  449.                 end
  450.             end
  451.         end
  452.     end
  453. end
Advertisement
RAW Paste Data Copied
Advertisement