Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- Synapse Decompiler
- -- Purchase Here: https://brack4712.xyz/synapse/purchase/
- local rs = game:GetService("RunService")
- local ts = game:GetService("TweenService")
- local uis = game:GetService("UserInputService")
- local ms = game:GetService("MarketplaceService")
- game.Players.LocalPlayer:WaitForChild("PlayerGui"):SetTopbarTransparency(1)
- local player = game.Players.LocalPlayer
- local mouse = player:GetMouse()
- local camera = game.Workspace.CurrentCamera
- local onIOS = game:GetService("UserInputService").TouchEnabled
- local mouseDown = false
- local soundOn = true
- local coins, inventory, equipped, ownedItems, offer, rebirths, skins, skinEquipped = game.Workspace.RemoteFunction:InvokeServer("GetStats")
- local ownedPasses = game.Workspace.RemoteFunction:InvokeServer("GetPasses")
- local blockModule = require(game.Lighting.Assets.Modules.BlockModule)
- local backpackModule = require(game.Lighting.Assets.Modules.BackpackModule)
- local musicModule = require(script.ModuleResources.MusicModule)
- local soundModule = require(script.ModuleResources.SoundModule)
- local animationModule = require(script.ModuleResources.AnimationModule)
- local toolModule = require(game.Lighting.Assets.Modules.ToolModule)
- local shopModule = require(game.Lighting.Assets.Modules.ShopModule)
- local cratesModule = require(game.Lighting.Assets.Modules.CrateModule)
- local textureModule = require(game.Lighting.Assets.Modules.TextureModule)
- local currentFrame = ""
- local uiPositions = {}
- local openPositions = {
- BackpackFull = UDim2.new(0.5, 0, 0.5),
- Customize = UDim2.new(0.5, 0, 0.5),
- CollapsedCave = UDim2.new(0.5, 0, 0.5),
- OpenShop = UDim2.new(0.5, 0, 0.5, 0),
- PurchaseFrame = UDim2.new(0.5, 0, 0.5, 0),
- BetterTool = UDim2.new(0.5, 0, 0.5, 0),
- StarterPack = UDim2.new(0.5, 0, 0.5, 0),
- Twitter = UDim2.new(0.5, 0, 0.5, 0),
- Rebirth = UDim2.new(0.5, 0, 0.5, 0),
- Bugs = UDim2.new(0.5, 0, 0.5, 0),
- JoinGroup = UDim2.new(0.5, 0, 0.5, 0),
- MainButtons = UDim2.new(),
- StatsFrame = UDim2.new(),
- StatsFrame2 = UDim2.new(),
- CratesFrame = UDim2.new(0.5, 0, 0.5, 0),
- InventoryFrame = UDim2.new(0.5, 0, 0.5, 0)
- }
- local shopIndex
- local shopCategory = ""
- local maxRange = 20
- local currentSound, currentAnim
- local debThing = false
- local collapse = game.Workspace.Collapse
- local selectionBox = script.SelectionBox:Clone()
- selectionBox.Parent = nil
- mouse.TargetFilter = game.Workspace.MiningArea
- local onXbox = uis.GamepadEnabled
- local rarityColors = {
- Common = Color3.new(1, 1, 1),
- Unique = Color3.new(1, 0.6941176470588235, 0.48627450980392156),
- Rare = Color3.new(1, 0.34509803921568627, 0.34509803921568627),
- Epic = Color3.new(0.6588235294117647, 0.41568627450980394, 1)
- }
- function addCommas(num)
- local f, k = num, nil
- while true do
- f, k = string.gsub(f, "^(-?%d+)(%d%d%d)", "%1,%2")
- if k == 0 then
- break
- end
- end
- return f
- end
- function colorRarity(obj, rarity)
- if rarity == "Legendary" then
- do
- local num = 0
- spawn(function()
- while true do
- if not wait() or not obj.Parent then
- break
- end
- if num > 1 then
- num = 0
- end
- num = num + 0.01
- if obj:IsA("TextLabel") then
- obj.TextColor3 = Color3.fromHSV(num, 0.4, 1)
- elseif obj:IsA("Frame") then
- for a, b in pairs(obj:GetChildren()) do
- b.ImageColor3 = Color3.fromHSV(num, 0.4, 1)
- end
- end
- end
- end)
- end
- elseif obj:IsA("TextLabel") then
- obj.TextColor3 = rarityColors[rarity]
- elseif obj:IsA("Frame") then
- for a, b in pairs(obj:GetChildren()) do
- b.ImageColor3 = rarityColors[rarity]
- end
- end
- end
- function updateSelectable()
- local function recurse(parent, var)
- for a, b in pairs(parent:GetChildren()) do
- do
- local can = pcall(function()
- local thing = b.Selectable
- end)
- if can then
- if b:IsA("TextButton") or b:IsA("ImageButton") then
- b.Selectable = var
- else
- b.Selectable = false
- end
- recurse(b, var)
- end
- end
- end
- end
- for a, b in pairs(openPositions) do
- local var = false
- if a == currentFrame then
- var = true
- end
- recurse(script.Parent[a], var)
- end
- end
- function displayCurrent()
- for a, b in pairs(script.Parent:GetChildren()) do
- if b:IsA("Frame") or b:IsA("ImageLabel") then
- pcall(function()
- b:TweenPosition(uiPositions[b.Name], "Out", "Sine", 0.25, true)
- end)
- end
- end
- if uiPositions[currentFrame] then
- script.Parent[currentFrame]:TweenPosition(openPositions[currentFrame], "Out", "Sine", 0.25, true)
- end
- updateSelectable()
- end
- function changeText(obj, text)
- obj.Text = text
- if obj:FindFirstChild("Shadow") then
- obj.Shadow.Text = text
- end
- end
- function chatBubble(plr, msg, color)
- if not plr:FindFirstChild("Head") then
- return
- end
- if plr.Head:FindFirstChild("ChatBubble") then
- do
- local bubbleType = ""
- if string.len(msg) > 65 then
- msg = string.sub(msg, 1, 65) .. "..."
- end
- if string.len(msg) > 50 then
- bubbleType = "BigBubble"
- elseif string.len(msg) > 30 then
- bubbleType = "MediumBubble"
- else
- bubbleType = "SmallBubble"
- end
- local bubble = script.ChatBubbles[bubbleType]:Clone()
- pcall(function()
- bubble.Backing.Old.ImageColor3 = color
- bubble.Backing.Recent.ImageColor3 = color
- end)
- for a, b in pairs(plr.Head.ChatBubble:GetChildren()) do
- if b:IsA("Frame") then
- local bubbleNum = tonumber(string.sub(b.Name, 7))
- if bubbleNum < 3 then
- local trans = 0.2 * bubbleNum
- b.Position = b.Position - UDim2.new(0, 0, bubble.Size.Y.Scale, 0)
- b.Backing.Old.Visible = true
- b.Backing.Recent.Visible = false
- b.Name = "Bubble" .. bubbleNum + 1
- b.Backing.Old.ImageTransparency = trans
- b.Backing.Recent.ImageTransparency = trans
- if b.Backing:FindFirstChild("Emoji") then
- b.Backing.Emoji.ImageTransparency = trans
- else
- b.Backing.Chat.TextTransparency = trans
- end
- else
- b:Destroy()
- end
- end
- end
- bubble.Parent = plr.Head.ChatBubble
- bubble.Name = "Bubble1"
- if bubble.Backing:FindFirstChild("Emoji") then
- bubble.Backing.Emoji.Image = msg
- else
- bubble.Backing.Chat.Text = msg
- end
- spawn(function()
- wait(5)
- if bubble.Parent then
- for i = 1, 100 do
- pcall(function()
- bubble.Backing.Old.ImageTransparency = bubble.Backing.Old.ImageTransparency + 0.01
- bubble.Backing.Recent.ImageTransparency = bubble.Backing.Recent.ImageTransparency + 0.01
- if bubble.Backing:FindFirstChild("Emoji") then
- bubble.Backing.Emoji.ImageTransparency = bubble.Backing.Emoji.ImageTransparency + 0.01
- else
- bubble.Backing.Chat.TextTransparency = bubble.Backing.Chat.TextTransparency + 0.01
- end
- rs.Stepped:wait()
- end)
- end
- bubble:Destroy()
- end
- end)
- end
- end
- end
- function findFirstParent(obj, parent)
- local function find(current)
- if current.Parent == parent then
- return current
- elseif current.Parent == game then
- return nil
- else
- return find(current.Parent)
- end
- end
- return find(obj)
- end
- function updateSelection()
- local targ
- if onXbox == false then
- targ = mouse.Target
- else
- local ray = Ray.new(camera.CFrame.p, (mouse.Hit.p - camera.CFrame.p).unit * 1000)
- local hit, pos = game.Workspace:FindPartOnRayWithIgnoreList(ray, {
- game.Workspace.MiningArea
- })
- targ = hit
- end
- if not targ then
- selectionBox.Parent = nil
- script.Parent.MiningFrame.Visible = false
- script.Parent.XboxFrame.MiningFrame.Visible = false
- if currentSound then
- currentSound:Stop()
- end
- return
- end
- if player.Character:FindFirstChild("Pickaxe") then
- if targ:IsDescendantOf(game.Workspace.Blocks) then
- script.Parent.XboxFrame.MiningFrame.Visible = onXbox
- else
- script.Parent.XboxFrame.MiningFrame.Visible = false
- end
- end
- local isBlock = findFirstParent(targ, game.Workspace.Blocks)
- if isBlock and player.Character:FindFirstChild("Pickaxe") and isBlock.Name ~= "Rock Bottom" then
- local dis = (isBlock.PrimaryPart.Position - player.Character.HumanoidRootPart.Position).magnitude
- selectionBox.Parent = game.Workspace.MiningArea
- selectionBox.CFrame = isBlock.PrimaryPart.CFrame
- script.Parent.MiningFrame.Visible = true
- if dis <= maxRange then
- selectionBox.Color = Color3.new(0, 1, 0)
- script.Parent.MiningFrame.ItemName.TextColor3 = blockModule[isBlock.Name][4]
- script.Parent.MiningFrame.Amount.Visible = true
- script.Parent.MiningFrame.Logo.Visible = true
- local amount = blockModule[isBlock.Name][5] * (ownedPasses.VIP == true and 2 or 1) * (1 + rebirths)
- changeText(script.Parent.MiningFrame.ItemName, isBlock.Name .. " - " .. addCommas(isBlock.Stats.Health.Value))
- changeText(script.Parent.MiningFrame.Amount, "Value: " .. addCommas(amount))
- script.Parent.MiningFrame.Logo.Position = script.Parent.MiningFrame.Amount.Position + UDim2.new(0, script.Parent.MiningFrame.Amount.TextBounds.X / 2 + 5, 0, 0)
- for a, b in pairs(script.Parent.MiningFrame.Progress:GetChildren()) do
- b.ImageColor3 = blockModule[isBlock.Name][4]
- end
- else
- selectionBox.Color = Color3.new(1, 0, 0)
- script.Parent.MiningFrame.ItemName.TextColor3 = Color3.new(1, 0, 0)
- script.Parent.MiningFrame.Amount.Visible = false
- script.Parent.MiningFrame.Logo.Visible = false
- changeText(script.Parent.MiningFrame.ItemName, "Out of range")
- for a, b in pairs(script.Parent.MiningFrame.Progress:GetChildren()) do
- b.ImageColor3 = Color3.new(1, 0, 0)
- end
- end
- else
- script.Parent.MiningFrame.Visible = false
- selectionBox.Parent = nil
- end
- end
- function inventoryContents()
- local num = 0
- for i = 1, #inventory do
- num = num + inventory[i][2]
- end
- return num
- end
- function displayStats()
- ts:Create(script.Parent.StatsFrame.Coins.Value, TweenInfo.new(1, Enum.EasingStyle.Sine, Enum.EasingDirection.Out, 0, false, 0), {Value = coins}):Play()
- local num = backpackModule[equipped[1]]
- if ownedPasses["Infinite Storage"] then
- num = "inf"
- else
- num = addCommas(num)
- end
- changeText(script.Parent.StatsFrame.Inventory.Amount, addCommas(inventoryContents()) .. " / " .. num)
- changeText(script.Parent.StatsFrame2.Inventory.Amount, addCommas(inventoryContents()) .. " / " .. num)
- spawn(function()
- wait(1)
- changeText(script.Parent.StatsFrame.Coins.Amount, addCommas(math.floor(coins)))
- changeText(script.Parent.StatsFrame2.Coins.Amount, addCommas(math.floor(coins)))
- end)
- end
- local mining = 0
- function mineBlock()
- local targ = mouse.Target
- if not targ or mining > 1 then
- return
- end
- local isBlock = findFirstParent(targ, game.Workspace.Blocks)
- local tool = player.Character:FindFirstChild("Pickaxe")
- if tool and tool:FindFirstChild("Explosive") then
- return
- end
- if isBlock then
- if isBlock.Name == "Rock Bottom" then
- return
- end
- if (isBlock.PrimaryPart.Position - player.Character.HumanoidRootPart.Position).magnitude <= maxRange then
- local broke = false
- mining = mining + 1
- if soundOn == true then
- if currentSound.SoundId ~= "rbxassetid://" .. soundModule[isBlock.Name][1] then
- currentSound.SoundId = "rbxassetid://" .. soundModule[isBlock.Name][1]
- currentSound.Looped = true
- currentSound:Play()
- end
- currentSound.Volume = soundModule[isBlock.Name][2]
- currentSound.Pitch = soundModule[isBlock.Name][3]
- end
- repeat
- wait()
- local start = tick()
- local mineTime = blockModule[isBlock.Name][3] / toolModule[player.Character.Pickaxe.Type.Value][1]
- local newTarg
- local del = 0.05
- local counter = 0
- if mineTime < 0.25 then
- mineTime = 0.25
- end
- mineTime = mineTime / (ownedPasses["2xDig"] and 2 or 1)
- if mineTime >= 20 then
- currentFrame = "BetterTool"
- displayCurrent()
- broke = true
- break
- end
- if not isBlock:FindFirstChild("Stats") then
- broke = true
- break
- end
- mineTime = mineTime * isBlock.Stats.Multiplier.Value
- script.Parent.MiningFrame.Progress:TweenSize(UDim2.new(1, -14, 1, -14), "Out", "Linear", mineTime, true)
- repeat
- wait(del)
- newTarg = mouse.Target
- newTarg = newTarg and findFirstParent(newTarg, game.Workspace.Blocks)
- counter = counter + del
- if counter > 1 then
- counter = 0
- end
- until mouseDown == false or mineTime <= tick() - start or newTarg ~= isBlock or not player.Character:FindFirstChild("Pickaxe")
- script.Parent.MiningFrame.Progress:TweenSize(UDim2.new(0, 14, 1, -14), "Out", "Sine", 0.01, true)
- if mouseDown == true and newTarg == isBlock and player.Character:FindFirstChild("Pickaxe") then
- local invNum = inventoryContents()
- if ownedPasses["Infinite Storage"] == true then
- invNum = 0
- end
- if mineTime <= tick() - start and invNum < backpackModule[equipped[1]] then
- game.Workspace.RemoteEvent:FireServer("MineBlock", isBlock)
- elseif inventoryContents() >= backpackModule[equipped[1]] then
- currentFrame = "BackpackFull"
- displayCurrent()
- end
- else
- broke = true
- end
- until broke == true or not isBlock.Parent
- mining = 0
- if mouseDown == true and player.Character:FindFirstChild("Pickaxe") then
- mineBlock()
- end
- end
- end
- end
- function coinAnimation(num)
- for i = 1, num do
- do
- local num = math.random(5, 8) / 100
- local rootPos = UDim2.new(0.5, 0, 0.7, 0)
- local money = script.UIResources.Money:Clone()
- money.Parent = script.Parent.SellFrame
- money.ImageTransparency = 1
- money.Size = UDim2.new(1, 0, num + 0.05, 0)
- money.Position = rootPos + UDim2.new(0, math.random(-50, 50), 0, math.random(-50, 50))
- spawn(function()
- ts:Create(money, TweenInfo.new(0.5, Enum.EasingStyle.Sine, Enum.EasingDirection.Out, 0, false, 0), {
- Size = UDim2.new(1, 0, num, 0),
- ImageTransparency = 0
- }):Play()
- wait(0.6)
- ts:Create(money, TweenInfo.new(1, Enum.EasingStyle.Sine, Enum.EasingDirection.Out, 0, false, 0), {
- Size = UDim2.new(1, 0, 0, 0),
- ImageTransparency = 1,
- Position = UDim2.new(0, script.Parent.StatsFrame.Coins.Logo.AbsolutePosition.X, 0, script.Parent.StatsFrame.Coins.Logo.AbsolutePosition.Y)
- }):Play()
- wait(1)
- money:Destroy()
- end)
- wait(math.random(1, 4) / 100)
- end
- end
- end
- function transitionSong(id)
- spawn(function()
- if soundOn == true then
- ts:Create(script.Parent.Music, TweenInfo.new(0.5, Enum.EasingStyle.Sine, Enum.EasingDirection.Out, 0, false, 0), {Volume = 0}):Play()
- wait(0.5)
- ts:Create(script.Parent.Music, TweenInfo.new(0.5, Enum.EasingStyle.Sine, Enum.EasingDirection.Out, 0, false, 0), {Volume = 0.25}):Play()
- end
- script.Parent.Music.SoundId = "rbxassetid://" .. id
- script.Parent.Music:Play()
- end)
- end
- function updateCollapsed()
- if game.Workspace.Collapsed.Value == true then
- if collapse.Parent ~= game.Workspace then
- collapse.Parent = game.Workspace
- end
- elseif collapse.Parent then
- collapse.Parent = nil
- end
- end
- function stopAnim()
- for a, b in pairs(player.Character.Humanoid:GetPlayingAnimationTracks()) do
- local found = false
- for c, d in pairs(script.ModuleResources.AnimationModule:GetChildren()) do
- if b.Name == d.Name then
- found = true
- break
- end
- end
- if found == true then
- b:Stop()
- end
- end
- local tool = player.Character:FindFirstChild("Pickaxe")
- if tool and (tool:FindFirstChild("Particle") or tool:FindFirstChild("Sound")) then
- game.Workspace.RemoteEvent:FireServer("PlayToolEffects", false)
- end
- currentAnim = nil
- end
- function updateShop(type)
- game.Workspace.Shop.Items:ClearAllChildren()
- shopCategory = type
- currentFrame = ""
- displayCurrent()
- script.Parent.MainButtons.Visible = false
- script.Parent.StatsFrame.Visible = false
- script.Parent.StatsFrame2.Visible = true
- script.Parent.TopInfoFrame.Visible = false
- script.Parent.ShopFrame.Visible = true
- game:GetService("StarterGui"):SetCoreGuiEnabled("Backpack", false)
- for i = 1, #shopModule[type] do
- local asset = game.Lighting.Assets.Shop[shopModule[type][i][1]]:Clone()
- asset.Parent = game.Workspace.Shop.Items
- if type ~= "Backpack" then
- asset:SetPrimaryPartCFrame(CFrame.new(game.Workspace.Shop.ItemPositions["Item" .. i].Look.Position) + Vector3.new(0, 0, 0))
- else
- asset:SetPrimaryPartCFrame(CFrame.new(game.Workspace.Shop.ItemPositions["Item" .. i].Look.Position) * CFrame.Angles(0, math.rad(180), 0) + Vector3.new(0, -1, 0))
- asset.Decore.Count.SurfaceGui.Fill.Size = UDim2.new(0, 0, 0, 0)
- local num = backpackModule[asset.Name]
- if num > 696969 then
- num = "inf"
- else
- num = "0/" .. addCommas(num)
- end
- changeText(asset.Decore.Count.SurfaceGui.Amount, num)
- end
- local light = Instance.new("PointLight", asset.PrimaryPart)
- light.Range = 15
- light.Brightness = 0.5
- if type == "Tools" then
- if asset.Name == equipped[3] then
- shopIndex = i
- end
- elseif type == "Backpack" and asset.Name == equipped[1] then
- shopIndex = i
- end
- end
- camera.CameraType = "Scriptable"
- camera.CFrame = CFrame.new(game.Workspace.Shop.ItemPositions["Item" .. shopIndex].Root.Position, game.Workspace.Shop.ItemPositions["Item" .. shopIndex].Look.Position)
- updateShopInfo()
- end
- function updateShopInfo()
- if not shopIndex then
- return
- end
- local item = shopModule[shopCategory][shopIndex]
- changeText(script.Parent.ShopFrame.Info.Title, shopCategory)
- changeText(script.Parent.ShopFrame.Info.ItemName, item[1])
- changeText(script.Parent.ShopFrame.Buy.Amount, addCommas(item[2]))
- script.Parent.ShopFrame.Buy.Logo.Position = UDim2.new(0.5, script.Parent.ShopFrame.Buy.Amount.TextBounds.X / 2 + 5, 0.5, 0)
- if shopCategory == "Tools" then
- local stats = toolModule[item[1]]
- if stats then
- script.Parent.ShopFrame.Buy.Storage.Visible = false
- script.Parent.ShopFrame.Buy.Damage.Visible = true
- changeText(script.Parent.ShopFrame.Buy.Damage, addCommas(stats[2]))
- if stats[5] then
- script.Parent.ShopFrame.Buy.Speed.Visible = false
- script.Parent.ShopFrame.Buy.Boom.Visible = true
- changeText(script.Parent.ShopFrame.Buy.Boom, addCommas(stats[5]))
- else
- script.Parent.ShopFrame.Buy.Speed.Visible = true
- script.Parent.ShopFrame.Buy.Boom.Visible = false
- changeText(script.Parent.ShopFrame.Buy.Speed, "x" .. addCommas(stats[1]))
- end
- else
- script.Parent.ShopFrame.Buy.Storage.Visible = false
- script.Parent.ShopFrame.Buy.Damage.Visible = false
- script.Parent.ShopFrame.Buy.Speed.Visible = false
- script.Parent.ShopFrame.Buy.Boom.Visible = false
- end
- else
- for a, b in pairs(script.Parent.ShopFrame.Buy:GetChildren()) do
- if b:IsA("TextLabel") and b.Name ~= "Amount" then
- if b.Name ~= "Storage" then
- b.Visible = false
- else
- b.Visible = true
- end
- end
- end
- local num = backpackModule[item[1]]
- local theHammer = 696969
- if num > theHammer then
- num = "inf"
- else
- num = addCommas(num)
- end
- changeText(script.Parent.ShopFrame.Buy.Storage, num)
- script.Parent.ShopFrame.Buy.Storage.Logo.Position = UDim2.new(0.5, -(script.Parent.ShopFrame.Buy.Storage.TextBounds.X / 2) - 10, 0.5, 0)
- end
- local owned = false
- for i = 1, #ownedItems do
- if ownedItems[i] == item[1] then
- owned = true
- break
- end
- end
- if item[3] then
- owned = ownedPasses[item[3][2]]
- end
- if owned == true then
- for a, b in pairs(script.Parent.ShopFrame.Buy.Decore.Inner:GetChildren()) do
- b.ImageColor3 = Color3.new(0.15294117647058825, 0.7058823529411765, 1)
- end
- for a, b in pairs(script.Parent.ShopFrame.Buy.Shadow:GetChildren()) do
- b.ImageColor3 = Color3.new(0.17647058823529413, 0.3686274509803922, 0.6)
- end
- local isEquipped = false
- if shopCategory == "Tools" then
- if equipped[3] == item[1] then
- isEquipped = true
- end
- elseif shopCategory == "Backpack" and equipped[1] == item[1] then
- isEquipped = true
- end
- changeText(script.Parent.ShopFrame.Buy.Amount, isEquipped == true and "Equipped" or "Equip")
- script.Parent.ShopFrame.Buy.Logo.Visible = false
- script.Parent.ShopFrame.Buy.Amount.TextColor3 = Color3.new(1, 1, 1)
- script.Parent.ShopFrame.Buy.Amount.AnchorPoint = Vector2.new(0.5, 0.5)
- else
- for a, b in pairs(script.Parent.ShopFrame.Buy.Decore.Inner:GetChildren()) do
- b.ImageColor3 = Color3.new(0.25882352941176473, 1, 0.12941176470588237)
- end
- for a, b in pairs(script.Parent.ShopFrame.Buy.Shadow:GetChildren()) do
- b.ImageColor3 = Color3.new(0, 0.5137254901960784, 0)
- end
- script.Parent.ShopFrame.Buy.Logo.Visible = true
- script.Parent.ShopFrame.Buy.Amount.TextColor3 = Color3.new(1, 0.7725490196078432, 0.24313725490196078)
- script.Parent.ShopFrame.Buy.Amount.AnchorPoint = Vector2.new(0.55, 0.5)
- end
- if item[3] and owned == false then
- script.Parent.ShopFrame.Buy.Logo.Visible = false
- script.Parent.ShopFrame.Buy.Amount.AnchorPoint = Vector2.new(0.5, 0.5)
- changeText(script.Parent.ShopFrame.Buy.Amount, addCommas(ms:GetProductInfo(item[3][1]).PriceInRobux) .. " R$")
- elseif owned == false then
- script.Parent.ShopFrame.Buy.Amount.AnchorPoint = Vector2.new(0.55, 0.5)
- script.Parent.ShopFrame.Buy.Logo.Visible = true
- end
- if item[3] and owned == true then
- changeText(script.Parent.ShopFrame.Buy.Amount, "Equipped")
- end
- if item[2] == "Group" then
- script.Parent.ShopFrame.Buy.Logo.Visible = false
- script.Parent.ShopFrame.Buy.Amount.AnchorPoint = Vector2.new(0.5, 0.5)
- changeText(script.Parent.ShopFrame.Buy.Amount, "Group Only")
- for a, b in pairs(script.Parent.ShopFrame.Buy.Decore.Inner:GetChildren()) do
- b.ImageColor3 = Color3.new(0.15294117647058825, 0.7058823529411765, 1)
- end
- for a, b in pairs(script.Parent.ShopFrame.Buy.Shadow:GetChildren()) do
- b.ImageColor3 = Color3.new(0.17647058823529413, 0.3686274509803922, 0.6)
- end
- if player:IsInGroup(3333298) then
- local isEquipped = false
- if shopCategory == "Tools" then
- if equipped[3] == item[1] then
- isEquipped = true
- end
- elseif shopCategory == "Backpack" and equipped[1] == item[1] then
- isEquipped = true
- end
- changeText(script.Parent.ShopFrame.Buy.Amount, isEquipped == true and "Equipped" or "Equip")
- end
- else
- script.Parent.ShopFrame.Buy.Amount.AnchorPoint = Vector2.new(0.55, 0.5)
- end
- end
- local shopDebounce = 0
- function closeShop()
- script.Parent.MainButtons.Visible = true
- script.Parent.StatsFrame.Visible = true
- script.Parent.StatsFrame2.Visible = false
- script.Parent.TopInfoFrame.Visible = true
- script.Parent.ShopFrame.Visible = false
- game:GetService("StarterGui"):SetCoreGuiEnabled("Backpack", true)
- game.Workspace.CurrentCamera.CameraSubject = game.Players.LocalPlayer.Character.Humanoid
- game.Workspace.CurrentCamera.CameraType = "Custom"
- shopDebounce = tick()
- end
- function secToTime(time)
- local hours = math.floor(time / 3600)
- time = time - hours * 60 * 60
- local mins = math.floor(time / 60)
- time = time - mins * 60
- return hours .. ":" .. mins .. ":" .. time
- end
- function buyShopItem()
- if debThing == true then
- return
- end
- debThing = true
- local item = shopModule[shopCategory][shopIndex]
- local owned = false
- for i = 1, #ownedItems do
- if ownedItems[i] == item[1] then
- owned = true
- break
- end
- end
- if item[3] then
- owned = ownedPasses[item[3][2]]
- end
- if owned == true then
- local isEquipped = false
- if shopCategory == "Tools" then
- if equipped[3] == item[1] then
- isEquipped = true
- end
- elseif shopCategory == "Backpacks" and isEquipped[1] == item[1] then
- isEquipped = true
- end
- if isEquipped == false then
- game.Workspace.RemoteEvent:FireServer("EquipItem", shopCategory, item[1])
- end
- elseif not item[3] then
- local sendRequest = false
- if item[2] ~= "Group" then
- if coins - item[2] >= 0 then
- sendRequest = true
- else
- ms:PromptProductPurchase(player, 151466115)
- currentFrame = "PurchaseFrame"
- changeText(script.Parent.PurchaseFrame.Title, "Coins")
- script.Parent.PurchaseFrame.Coins.Visible = true
- script.Parent.PurchaseFrame.Passes.Visible = false
- displayCurrent()
- end
- else
- sendRequest = true
- end
- if sendRequest == true then
- game.Workspace.RemoteEvent:FireServer("BuyItem", shopCategory, shopIndex)
- end
- else
- ms:PromptPurchase(player, item[3][1])
- end
- wait(0.25)
- debThing = false
- end
- function getSkin(crate)
- local possible = {}
- local chosen = ""
- local rarities = {}
- local textureItems = {}
- for a, b in pairs(textureModule) do
- table.insert(textureItems, a)
- end
- for a, b in pairs(cratesModule[crate][3]) do
- table.insert(rarities, {
- a,
- cratesModule[crate][3][a]
- })
- end
- for i = 1, #rarities do
- for j = 1, math.floor(rarities[i][2] * 10) do
- table.insert(possible, rarities[i][1])
- end
- end
- chosen = possible[math.random(1, #possible)]
- local knife
- repeat
- local possibility = textureItems[math.random(1, #textureItems)]
- if textureModule[possibility] == chosen then
- knife = possibility
- end
- until knife ~= nil
- return knife
- end
- function spinCrate(winner, crate)
- local crateFrame = script.UIResources.CrateSystem:Clone()
- crateFrame.Parent = script.Parent
- local frame = crateFrame.Items.Items.Items
- spawn(function()
- wait(20)
- if frame.Parent then
- frame:Destroy()
- currentFrame = "InventoryFrame"
- displayCurrent()
- end
- end)
- for a, b in pairs(frame:GetChildren()) do
- if b:IsA("Frame") then
- b:Destroy()
- end
- end
- frame:TweenPosition(UDim2.new(), "Out", "Linear", 0.01)
- wait(0.05)
- for i = 1, 33 do
- local knife
- local item = script.UIResources.CrateItem:Clone()
- item.Parent = frame
- if i == 30 then
- knife = winner
- else
- knife = getSkin(crate)
- end
- item.Decore.Primary.Image = game.Lighting.Assets.Textures[knife].PrimaryTexture.Texture
- item.Decore.Primary.ImageColor3 = game.Lighting.Assets.Textures[knife].PrimaryTexture.Color3
- item.Decore.Primary.BackgroundColor3 = game.Lighting.Assets.Textures[knife].Primary.Color
- changeText(item.Decore.ItemName, knife)
- colorRarity(item.Decore.ItemName, textureModule[knife])
- changeText(item.Decore.ItemName, knife)
- end
- currentFrame = ""
- displayCurrent()
- crateFrame:TweenPosition(UDim2.new(0.5, 0, 0.5, 0), "Out", "Sine", 0.5, true)
- wait(1)
- local speed = math.random(9, 12)
- frame:TweenPosition(UDim2.new(-4.8, 0, 0, 0), "Out", "Quint", speed / 2, true)
- wait(speed / 10)
- frame:TweenPosition(UDim2.new(-4.8, 0, 0, 0), "Out", "Quint", speed / 1, true)
- spawn(function()
- wait(speed / 2 + 2)
- crateFrame:Destroy()
- currentFrame = "InventoryFrame"
- displayCurrent()
- end)
- end
- function updateInventory()
- for a, b in pairs(script.Parent.InventoryFrame.Items.Items:GetChildren()) do
- if b:IsA("TextButton") or b:IsA("Frame") then
- b:Destroy()
- end
- end
- for i = 1, #skins do
- do
- local item = script.UIResources.InventoryItem:Clone()
- item.Parent = script.Parent.InventoryFrame.Items.Items
- if skins[i][1] ~= "Default" then
- item.Decore.Primary.Image = game.Lighting.Assets.Textures[skins[i][1]].PrimaryTexture.Texture
- item.Decore.Primary.ImageColor3 = game.Lighting.Assets.Textures[skins[i][1]].PrimaryTexture.Color3
- item.Decore.Primary.BackgroundColor3 = game.Lighting.Assets.Textures[skins[i][1]].Primary.Color
- changeText(item.Decore.ItemName, skins[i][1])
- colorRarity(item.Decore.ItemName, textureModule[skins[i][1]])
- else
- item.Decore.Primary.Visible = false
- end
- changeText(item.Decore.Amount, 1 < skins[i][2] and "x" .. skins[i][2] or "")
- changeText(item.Decore.ItemName, skins[i][1])
- if skins[i][1] == skinEquipped then
- for a, b in pairs(item.Decore.Decore.Border:GetChildren()) do
- b.ImageColor3 = Color3.new(0, 1, 0)
- end
- end
- item.MouseButton1Down:connect(function()
- game.Workspace.RemoteEvent:FireServer("EquipTexture", skins[i][1])
- end)
- end
- end
- spawn(function()
- wait(0.5)
- script.Parent.InventoryFrame.Items.Items.CanvasSize = UDim2.new(0, 0, 0, script.Parent.InventoryFrame.Items.Items.UIGridLayout.AbsoluteContentSize.Y)
- end)
- end
- script.Event.Event:connect(function(type, ...)
- if type == "StopAnim" then
- stopAnim()
- end
- end)
- game.Workspace.RemoteEvent.OnClientEvent:connect(function(type, ...)
- if type == "PassesChanged" then
- ownedPasses = (...)
- updateShopInfo()
- if ownedPasses["Infinite Storage"] == true then
- script.Parent.BackpackFull.Infinite.Visible = false
- end
- if ownedPasses.Nuke == true then
- script.Parent.BetterTool.Nuke.Visible = false
- end
- if ownedPasses.VIP == true and game.Workspace:FindFirstChild("VIPWall") then
- game.Workspace.VIPWall:Destroy()
- end
- if ownedPasses["2xDig"] == true then
- script.Parent.CollapsedCave.FastDig.Visible = false
- script.Parent.Customize.Dig.Visible = false
- end
- elseif type == "StatsChanged" then
- coins, inventory, equipped, ownedItems, offer, rebirths, skins, skinEquipped = ...
- displayStats()
- updateShopInfo()
- if offer[2] == true or onXbox == true then
- currentFrame = ""
- displayCurrent()
- script.Parent.StatsFrame.StarterPackButton.Visible = false
- end
- elseif type == "PlayerChatted" then
- local plr, msg, col = ...
- chatBubble(plr.Character, msg, col)
- elseif type == "SellingAnimation" then
- do
- local num = (...)
- local originalNum = num
- if num > 15 then
- num = 15
- end
- script.Parent.SellFrame.Amount.Amount.Text = "+" .. addCommas(originalNum)
- ts:Create(script.Parent.SellFrame.Amount.Amount, TweenInfo.new(1, Enum.EasingStyle.Sine, Enum.EasingDirection.Out, 0, false, 0), {TextTransparency = 0, TextStrokeTransparency = 0.5}):Play()
- ts:Create(script.Parent.SellFrame.Amount.Logo, TweenInfo.new(1, Enum.EasingStyle.Sine, Enum.EasingDirection.Out, 0, false, 0), {ImageTransparency = 0}):Play()
- spawn(function()
- coinAnimation(num)
- end)
- wait(2)
- ts:Create(script.Parent.SellFrame.Amount.Amount, TweenInfo.new(1, Enum.EasingStyle.Sine, Enum.EasingDirection.Out, 0, false, 0), {TextTransparency = 1, TextStrokeTransparency = 1}):Play()
- ts:Create(script.Parent.SellFrame.Amount.Logo, TweenInfo.new(1, Enum.EasingStyle.Sine, Enum.EasingDirection.Out, 0, false, 0), {ImageTransparency = 1}):Play()
- end
- elseif type == "StopAnim" then
- stopAnim()
- elseif type == "InventoryFull" then
- currentFrame = "BackpackFull"
- displayCurrent()
- elseif type == "SpecialOffer" then
- wait(1)
- currentFrame = "StarterPack"
- displayCurrent()
- elseif type == "JoinGroup" then
- currentFrame = "JoinGroup"
- displayCurrent()
- elseif type == "UpdateInventory" then
- skinEquipped, skins = ...
- updateInventory()
- elseif type == "OpenCrate" then
- spinCrate(...)
- end
- end)
- for a, b in pairs(script.Parent:GetChildren()) do
- if b:IsA("Frame") or b:IsA("ImageLabel") then
- uiPositions[b.Name] = b.Position
- end
- end
- for a, b in pairs(game.Workspace.NPCs:GetChildren()) do
- spawn(function()
- local anim = b.Humanoid:LoadAnimation(script.Animations.WaveAnim)
- wait(math.random(0, 20 * a) / 10)
- anim:Play()
- end)
- end
- do
- local lastVal = coins
- local last = tick()
- script.Parent.StatsFrame.Coins.Value.Changed:connect(function()
- if lastVal ~= coins and tick() - last > 0.1 then
- last = tick()
- lastVal = math.ceil(script.Parent.StatsFrame.Coins.Value.Value)
- changeText(script.Parent.StatsFrame.Coins.Amount, addCommas(math.ceil(script.Parent.StatsFrame.Coins.Value.Value)))
- changeText(script.Parent.StatsFrame2.Coins.Amount, script.Parent.StatsFrame.Coins.Amount.Text)
- local sound = game.Lighting.Assets.Sounds.Coins:Clone()
- sound.Parent = script.Parent.StatsFrame.Coins
- sound:Play()
- wait(sound.TimeLength)
- sound:Destroy()
- end
- end)
- end
- script.Parent.BackpackFull.Sell.MouseButton1Down:connect(function()
- currentFrame = ""
- displayCurrent()
- player.Character:SetPrimaryPartCFrame(CFrame.new(game.Workspace.TeleportPoints.SellSpawn.Position) + Vector3.new(0, 3, 0))
- end)
- script.Parent.BackpackFull.Upgrade.MouseButton1Down:connect(function()
- currentFrame = ""
- displayCurrent()
- player.Character:SetPrimaryPartCFrame(CFrame.new(game.Workspace.TeleportPoints.UpgradeSpawn.Position) + Vector3.new(0, 3, 0))
- end)
- script.Parent.BackpackFull.Upgrade.MouseButton1Down:connect(function()
- currentFrame = ""
- displayCurrent()
- player.Character:SetPrimaryPartCFrame(CFrame.new(game.Workspace.TeleportPoints.UpgradeSpawn.Position) + Vector3.new(0, 3, 0))
- end)
- script.Parent.MainButtons.Surface.MouseButton1Down:connect(function()
- currentFrame = ""
- displayCurrent()
- player.Character:SetPrimaryPartCFrame(CFrame.new(game.Workspace.TeleportPoints.SurfaceSpawn.Position) + Vector3.new(0, 3, 0))
- end)
- script.Parent.BackpackFull.Close.MouseButton1Down:connect(function()
- currentFrame = ""
- displayCurrent()
- end)
- script.Parent.MainButtons.Sound.MouseButton1Down:connect(function()
- soundOn = not soundOn
- if soundOn == true then
- script.Parent.MainButtons.Sound.Decore.ItemImage.Image = "rbxassetid://1417525348"
- script.Parent.Music.Volume = 0.25
- else
- script.Parent.MainButtons.Sound.Decore.ItemImage.Image = "rbxassetid://1420443979"
- script.Parent.Music.Volume = 0
- end
- end)
- script.Parent.MainButtons.Customize.MouseButton1Down:connect(function()
- currentFrame = "Customize"
- displayCurrent()
- end)
- script.Parent.Customize.Close.MouseButton1Down:connect(function()
- currentFrame = ""
- displayCurrent()
- end)
- for a, b in pairs(script.Parent.Customize.Colors:GetChildren()) do
- if b:IsA("TextButton") then
- b.MouseButton1Down:connect(function()
- game.Workspace.RemoteEvent:FireServer("ChangeColor", b.Name)
- currentFrame = ""
- displayCurrent()
- end)
- end
- end
- do
- local anim = game.Workspace.Collapse.Miner.Humanoid:LoadAnimation(script.Animations.MinerIdle)
- anim:Play()
- end
- game.Workspace.Collapsed.Changed:connect(function()
- updateCollapsed()
- if game.Workspace.Collapsed.Value == true then
- currentFrame = "CollapsedCave"
- displayCurrent()
- end
- end)
- script.Parent.CollapsedCave.Okay.MouseButton1Down:connect(function()
- currentFrame = ""
- displayCurrent()
- end)
- script.Parent.CollapsedCave.Close.MouseButton1Down:connect(function()
- currentFrame = ""
- displayCurrent()
- end)
- script.Parent.ShopFrame.Right.MouseButton1Down:connect(function()
- shopIndex = shopIndex + 1
- local speed = 0.01
- if shopIndex > #shopModule[shopCategory] then
- shopIndex = 1
- else
- speed = 1.5
- end
- ts:Create(camera, TweenInfo.new(speed, Enum.EasingStyle.Sine, Enum.EasingDirection.Out, 0, false, 0), {
- CFrame = CFrame.new(game.Workspace.Shop.ItemPositions["Item" .. shopIndex].Root.Position, game.Workspace.Shop.ItemPositions["Item" .. shopIndex].Look.Position)
- }):Play()
- updateShopInfo()
- end)
- script.Parent.ShopFrame.Left.MouseButton1Down:connect(function()
- shopIndex = shopIndex - 1
- local speed = 0.01
- if shopIndex < 1 then
- shopIndex = #shopModule[shopCategory]
- else
- speed = 1.5
- end
- ts:Create(camera, TweenInfo.new(speed, Enum.EasingStyle.Sine, Enum.EasingDirection.Out, 0, false, 0), {
- CFrame = CFrame.new(game.Workspace.Shop.ItemPositions["Item" .. shopIndex].Root.Position, game.Workspace.Shop.ItemPositions["Item" .. shopIndex].Look.Position)
- }):Play()
- updateShopInfo()
- end)
- script.Parent.ShopFrame.Buy.MouseButton1Down:connect(function()
- buyShopItem()
- end)
- script.Parent.ShopFrame.Exit.MouseButton1Down:connect(function()
- closeShop()
- end)
- script.Parent.ShopFrame.Close.MouseButton1Down:connect(function()
- closeShop()
- end)
- script.Parent.OpenShop.Close.MouseButton1Down:connect(function()
- shopDebounce = tick()
- currentFrame = ""
- displayCurrent()
- end)
- script.Parent.OpenShop.Tools.MouseButton1Down:connect(function()
- updateShop("Tools")
- end)
- script.Parent.OpenShop.Backpacks.MouseButton1Down:connect(function()
- updateShop("Backpack")
- end)
- script.Parent.TeleporterFrame.Teleport.MouseButton1Down:connect(function()
- game.Workspace.RemoteEvent:FireServer("TeleportToPad")
- end)
- script.Parent.TeleporterFrame.Move.MouseButton1Down:connect(function()
- game.Workspace.RemoteEvent:FireServer("RemovePad")
- for a, b in pairs(script.Parent.TeleporterFrame:GetChildren()) do
- if b:IsA("TextButton") then
- b.Visible = false
- end
- end
- script.Parent.TeleporterFrame.Info.Visible = true
- end)
- for a, b in pairs(script.Parent.PurchaseFrame.Coins:GetChildren()) do
- if b:IsA("TextButton") then
- b.MouseButton1Down:connect(function()
- ms:PromptProductPurchase(player, b.DevProduct.Value)
- end)
- end
- end
- script.Parent.PurchaseFrame.Close.MouseButton1Down:connect(function()
- currentFrame = ""
- displayCurrent()
- end)
- script.Parent.StatsFrame.Coins.More.MouseButton1Down:connect(function()
- currentFrame = "PurchaseFrame"
- displayCurrent()
- changeText(script.Parent.PurchaseFrame.Title, "Coins")
- script.Parent.PurchaseFrame.Coins.Visible = true
- script.Parent.PurchaseFrame.Passes.Visible = false
- end)
- script.Parent.StatsFrame2.Coins.More.MouseButton1Down:connect(function()
- currentFrame = "PurchaseFrame"
- displayCurrent()
- changeText(script.Parent.PurchaseFrame.Title, "Coins")
- script.Parent.PurchaseFrame.Coins.Visible = true
- script.Parent.PurchaseFrame.Passes.Visible = false
- end)
- script.Parent.MainButtons.Shop.MouseButton1Down:connect(function()
- currentFrame = "PurchaseFrame"
- displayCurrent()
- end)
- script.Parent.PurchaseFrame.CoinsButton.MouseButton1Down:connect(function()
- changeText(script.Parent.PurchaseFrame.Title, "Coins")
- script.Parent.PurchaseFrame.Coins.Visible = true
- script.Parent.PurchaseFrame.Passes.Visible = false
- end)
- script.Parent.PurchaseFrame.Gamepasses.MouseButton1Down:connect(function()
- changeText(script.Parent.PurchaseFrame.Title, "Gamepasses")
- script.Parent.PurchaseFrame.Coins.Visible = false
- script.Parent.PurchaseFrame.Passes.Visible = true
- end)
- for a, b in pairs(script.Parent.PurchaseFrame.Passes:GetChildren()) do
- if b:IsA("TextButton") then
- local info = ms:GetProductInfo(b.DevProduct.Value)
- changeText(b.Cost, addCommas(info.PriceInRobux) .. " R$")
- b.MouseButton1Down:connect(function()
- ms:PromptPurchase(player, b.DevProduct.Value)
- end)
- end
- end
- script.Parent.BetterTool.Upgrade.MouseButton1Down:connect(function()
- currentFrame = ""
- displayCurrent()
- player.Character:SetPrimaryPartCFrame(CFrame.new(game.Workspace.TeleportPoints.UpgradeSpawn.Position) + Vector3.new(0, 3, 0))
- end)
- script.Parent.BetterTool.Close.MouseButton1Down:connect(function()
- currentFrame = ""
- displayCurrent()
- end)
- script.Parent.BetterTool.Cancel.MouseButton1Down:connect(function()
- currentFrame = ""
- displayCurrent()
- end)
- script.Parent.BackpackFull.Infinite.Buy.MouseButton1Down:connect(function()
- ms:PromptPurchase(player, 1435271062)
- end)
- script.Parent.BetterTool.Nuke.Buy.MouseButton1Down:connect(function()
- ms:PromptPurchase(player, 1435274498)
- end)
- if game.Workspace:FindFirstChild("VIPWall") then
- game.Workspace.VIPWall.Touched:connect(function(t)
- local plr = game.Players:FindFirstChild(t.Parent.Name)
- if plr and plr == player then
- ms:PromptPurchase(player, 1435282640)
- end
- end)
- end
- game.Workspace.VIPSign.Part.SurfaceGui.Buy.MouseButton1Down:connect(function()
- ms:PromptPurchase(player, 1435282640)
- end)
- script.Parent.CollapsedCave.FastDig.Buy.MouseButton1Down:connect(function()
- ms:PromptPurchase(player, 1435267597)
- end)
- script.Parent.Customize.Dig.Buy.MouseButton1Down:connect(function()
- ms:PromptPurchase(player, 1435267597)
- end)
- script.Parent.StatsFrame.StarterPackButton.MouseButton1Down:connect(function()
- currentFrame = "StarterPack"
- displayCurrent()
- end)
- script.Parent.StarterPack.Close.MouseButton1Down:connect(function()
- currentFrame = ""
- displayCurrent()
- end)
- script.Parent.StarterPack.Buy.MouseButton1Down:connect(function()
- ms:PromptProductPurchase(player, 152576666)
- end)
- script.Parent.Customize.Dig.Buy.MouseButton1Down:connect(function()
- ms:PromptPurchase(player, 1435267597)
- end)
- do
- local lastText = script.Parent.Twitter.Code.Text
- script.Parent.Twitter.Code.Changed:connect(function()
- if lastText ~= script.Parent.Twitter.Code.Text then
- changeText(script.Parent.Twitter.Code.ItemName, script.Parent.Twitter.Code.Text)
- lastText = script.Parent.Twitter.Code.Text
- end
- end)
- end
- script.Parent.Twitter.Code.Focused:connect(function()
- changeText(script.Parent.Twitter.Code.ItemName, "")
- end)
- script.Parent.Twitter.Send.MouseButton1Down:connect(function()
- local response = game.Workspace.RemoteFunction:InvokeServer("RedeemCode", script.Parent.Twitter.Code.Text)
- script.Parent.Twitter.Code.Text = response
- end)
- script.Parent.Twitter.Close.MouseButton1Down:connect(function()
- currentFrame = ""
- displayCurrent()
- end)
- do
- local lastText = script.Parent.Bugs.Code.Text
- script.Parent.Bugs.Code.Changed:connect(function()
- if lastText ~= script.Parent.Bugs.Code.Text then
- changeText(script.Parent.Bugs.Code.ItemName, script.Parent.Bugs.Code.Text)
- lastText = script.Parent.Bugs.Code.Text
- end
- end)
- end
- script.Parent.Bugs.Code.Focused:connect(function()
- changeText(script.Parent.Bugs.Code.ItemName, "")
- end)
- local lastSend = 0
- script.Parent.Bugs.Send.MouseButton1Down:connect(function()
- if tick() - lastSend <= 60 then
- script.Parent.Bugs.Code.Text = "Please wait " .. 60 - math.floor(tick() - lastSend) .. " second" .. (60 - math.floor(tick() - lastSend) > 1 and "s" or "") .. " before submitting another bug"
- return
- end
- lastSend = tick()
- game.Workspace.RemoteEvent:FireServer("BugReport", script.Parent.Bugs.Code.Text)
- script.Parent.Bugs.Code.Text = "Thanks for your input!"
- end)
- script.Parent.Bugs.Close.MouseButton1Down:connect(function()
- currentFrame = ""
- displayCurrent()
- end)
- for a, b in pairs(script.Parent.StatsFrame.SubButtons:GetChildren()) do
- if b:IsA("TextButton") then
- b.MouseButton1Down:connect(function()
- currentFrame = b.Name
- displayCurrent()
- if b.Name == "Rebirth" then
- changeText(script.Parent.Rebirth.Multiplier, "Your ore value will be " .. 2 + rebirths .. "x after rebirthing")
- changeText(script.Parent.Rebirth.CoinsNeeded, "You need " .. addCommas(10000000 * (rebirths + 1)) .. " coins to rebirth")
- end
- end)
- end
- end
- local redeb = false
- script.Parent.Rebirth.Send.MouseButton1Down:connect(function()
- if redeb == true then
- return
- end
- redeb = true
- if coins - 10000000 * (rebirths + 1) >= 0 then
- game.Workspace.RemoteEvent:FireServer("Rebirth")
- currentFrame = ""
- displayCurrent()
- else
- changeText(script.Parent.PurchaseFrame.Title, "Coins")
- script.Parent.PurchaseFrame.Coins.Visible = true
- script.Parent.PurchaseFrame.Passes.Visible = false
- currentFrame = "PurchaseFrame"
- displayCurrent()
- end
- wait(0.25)
- redeb = false
- end)
- script.Parent.Rebirth.Close.MouseButton1Down:connect(function()
- currentFrame = ""
- displayCurrent()
- end)
- script.Parent.JoinGroup.Okay.MouseButton1Down:connect(function()
- currentFrame = ""
- displayCurrent()
- end)
- script.Parent.JoinGroup.Close.MouseButton1Down:connect(function()
- currentFrame = ""
- displayCurrent()
- end)
- script.Parent.InventoryFrame.Close.MouseButton1Down:connect(function()
- currentFrame = ""
- displayCurrent()
- end)
- function updateXbox()
- local can = currentFrame ~= "BackpackFull" and currentFrame ~= "OpenShop" and currentFrame ~= "BetterTool" and currentFrame ~= "CollapsedCave" and currentFrame ~= "JoinGroup" and currentFrame ~= "Customize"
- local frames = {
- script.Parent.PurchaseFrame,
- script.Parent.BackpackFull,
- script.Parent.OpenShop,
- script.Parent.BetterTool,
- script.Parent.CollapsedCave,
- script.Parent.JoinGroup,
- script.Parent.Customize,
- script.Parent.ShopFrame,
- script.Parent.CratesFrame,
- script.Parent.InventoryFrame
- }
- local function recurse(parent, var)
- for a, b in pairs(parent:GetChildren()) do
- do
- local can = pcall(function()
- local thing = b.Selectable
- end)
- if can then
- if b.Name == "XboxButton" then
- b.Visible = var
- end
- recurse(b, var)
- end
- end
- end
- end
- script.Parent.StatsFrame.SubButtons.Twitter.Visible = not onXbox
- script.Parent.StatsFrame.SubButtons.Rebirth.XboxButton.Visible = onXbox
- script.Parent.StatsFrame.SubButtons.InventoryFrame.XboxButton.Visible = onXbox
- for a, b in pairs(script.Parent.MainButtons:GetChildren()) do
- if b:IsA("TextButton") then
- if onXbox == false then
- b.Visible = true
- if b:FindFirstChild("XboxButton") then
- b.XboxButton.Visible = false
- end
- elseif b:FindFirstChild("XboxButton") then
- b.Visible = true
- b.XboxButton.Visible = true
- else
- b.Visible = false
- end
- end
- end
- for i = 1, #frames do
- recurse(frames[i], onXbox)
- end
- end
- uis.GamepadConnected:connect(function()
- onXbox = true
- updateXbox()
- end)
- uis.GamepadDisconnected:connect(function()
- onXbox = false
- updateXbox()
- end)
- uis.InputBegan:connect(function(input)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement