Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- Decompiled with the Synapse X Luau decompiler.
- local v1 = require(game.ReplicatedStorage:WaitForChild("Framework"):WaitForChild("Library"));
- while not v1.Loaded do
- game:GetService("RunService").Heartbeat:Wait();
- end;
- function HasLanded(p1)
- local v2 = p1 and p1.EndTime <= workspace:GetServerTimeNow() + 0.5;
- return v2;
- end;
- function CometAnimation(p2)
- if p2 then
- if HasLanded(p2) then
- return;
- end;
- else
- return;
- end;
- animating = true;
- local v3 = v1.Assets.Models.Comets:FindFirstChild(p2.Type):Clone();
- local v4 = Instance.new("Model");
- v3.Parent = v4;
- v4.PrimaryPart = v3;
- if p2.Type == "Massive Comet" then
- v1.Functions.Scaler()(v4, 3);
- end;
- p2.Model = v3;
- local v5 = p2.EndPosition + Vector3.new(0, v3.Size.Y / 2 - v3.Size.Y / 3, 0);
- local v6 = (p2.EndTime - workspace:GetServerTimeNow()) / p2.Speed;
- local v7 = p2.StartPosition.Y - v5.Y;
- v3.Position = v5 + Vector3.new(0, v7 * v6, v7 * 0.4663076581549986);
- v3.Orientation = Vector3.new(25, 0, 0);
- v4.Parent = v1.Things:WaitForChild("Comets");
- p2.TravelTween = v1.TweenService:Create(v3, TweenInfo.new(p2.Speed * v6, Enum.EasingStyle.Circular, Enum.EasingDirection.In, 0), {
- Position = v5
- });
- p2.TravelTween:Play();
- p2.TravelTween.Completed:Connect(function(p3)
- if p3 == Enum.PlaybackState.Cancelled then
- return;
- end;
- v3.Transparency = 1;
- v1.Functions.AddDebris(v3, 5);
- local v8, v9, v10 = pairs(v3:GetChildren());
- while true do
- local v11, v12 = v8(v9, v10);
- if v11 then
- else
- break;
- end;
- v10 = v11;
- if v12.Name ~= "Explosion" then
- v12:Destroy();
- end;
- end;
- local v13, v14, v15 = pairs(v3:FindFirstChild("Explosion"):GetChildren());
- while true do
- local v16, v17 = v13(v14, v15);
- if v16 then
- else
- break;
- end;
- v15 = v16;
- v17:Emit(v17:GetAttribute("EmitCount") and 1);
- end;
- animating = false;
- if p2.Coin then
- v1.Signal.Fire("Comets: Setup Breakable", p2.CoinId, p2.Coin);
- end;
- local v18 = v1.Save.Get();
- if v18 then
- if p2.Type == "Massive Comet" then
- if v18.World == p2.WorldId then
- v1.Shake.Create(2, 1, 0.3);
- local v19 = v1.Audio.Play("rbxassetid://12669914523", v3, 1, 0.6);
- v19.RollOffMaxDistance = 800;
- v19.RollOffMinDistance = 300;
- p2.LandSound = true;
- return;
- end;
- end;
- if p2.Type == "Mini Comet" then
- if v18.World == p2.WorldId then
- v1.Shake.Create(1, 0.3, 0.3);
- local v20 = v1.Audio.Play("rbxassetid://12669914204", v3, 1, 0.4);
- v20.RollOffMaxDistance = 500;
- v20.RollOffMinDistance = 200;
- end;
- end;
- end;
- end);
- end;
- function CancelAnimation(p4)
- animating = false;
- if not p4 then
- return;
- end;
- if p4.Model then
- p4.Model:Destroy();
- p4.Model = nil;
- end;
- if p4.TravelTween then
- p4.TravelTween:Cancel();
- p4.TravelTween = nil;
- end;
- end;
- function RemoveBroken(p5)
- if not p5 then
- return;
- end;
- if p5.BrokenModel then
- p5.BrokenModel:Destroy();
- p5.BrokenModel = nil;
- end;
- if p5.Egg then
- p5.Egg:Destroy();
- p5.Egg = nil;
- end;
- end;
- local u1 = {};
- function SpawnComet(p6, p7)
- local v21 = {
- Id = p6.Id,
- Type = p6.Type,
- WorldId = p6.WorldId,
- AreaId = p6.AreaId,
- CoinId = p6.CoinId,
- StartPosition = p6.SpawnPosition,
- EndPosition = p6.EndPosition,
- Speed = p6.Speed,
- EndTime = p6.EndTime,
- Destroyed = p6.Destroyed,
- Opened = p7
- };
- u1[v21.Id] = v21;
- local v22 = v1.Save.Get();
- if not v22 then
- return;
- end;
- if v21.Type == "Massive Comet" then
- if not HasLanded(v21) then
- local v23 = v21.Speed * ((v21.EndTime - workspace:GetServerTimeNow()) / v21.Speed);
- local v24 = v1.Directory.Areas[v21.AreaId];
- v1.Signal.Fire("Notification", "A Massive Comet is landing in " .. v24.name .. "!", {
- color = Color3.fromRGB(0, 170, 255),
- force = true
- });
- v1.ChatMsg.New("A Massive Comet is landing in " .. v24.name .. "!", Color3.fromRGB(0, 170, 255));
- v1.Shake.Create(v23, 0.1, 0.3, true);
- elseif v21.Type == "Mini Comet" then
- if not HasLanded(v21) then
- local v25 = (v21.EndTime - workspace:GetServerTimeNow()) / v21.Speed;
- local v26 = v1.Directory.Areas[v21.AreaId];
- v1.Signal.Fire("Notification", "A Mini Comet is landing in " .. v26.name .. "!", {
- color = Color3.fromRGB(0, 170, 255),
- force = true
- });
- v1.ChatMsg.New("A Mini Comet is landing in " .. v26.name .. "!", Color3.fromRGB(0, 170, 255));
- end;
- end;
- elseif v21.Type == "Mini Comet" then
- if not HasLanded(v21) then
- v25 = (v21.EndTime - workspace:GetServerTimeNow()) / v21.Speed;
- v26 = v1.Directory.Areas[v21.AreaId];
- v1.Signal.Fire("Notification", "A Mini Comet is landing in " .. v26.name .. "!", {
- color = Color3.fromRGB(0, 170, 255),
- force = true
- });
- v1.ChatMsg.New("A Mini Comet is landing in " .. v26.name .. "!", Color3.fromRGB(0, 170, 255));
- end;
- end;
- if v22.World == v21.WorldId then
- if not v21.Destroyed then
- CometAnimation(v21);
- end;
- end;
- end;
- function SetupCometEgg(p8)
- if p8 then
- if not p8.Coin then
- return;
- end;
- else
- return;
- end;
- p8.Destroyed = true;
- local v27 = v1.Assets.Models.Comets:WaitForChild("Massive Comet Broken"):Clone();
- v1.Functions.Scaler()(v27, 4);
- v27.CFrame = p8.Coin.CFrame - Vector3.new(0, v27.Size.Y / 6, 0);
- v27.Parent = v1.Things:WaitForChild("Comets");
- p8.BrokenModel = v27;
- local v28 = v1.Audio.Play("rbxassetid://12669914691", v27, 1, 0.2, nil, nil, true);
- v28.RollOffMaxDistance = 300;
- v28.RollOffMinDistance = 100;
- if not p8.Opened then
- local v29 = v1.Assets.Models.Comets:WaitForChild("Comet Egg"):Clone();
- v29:SetPrimaryPartCFrame(CFrame.new(v27.Position + Vector3.new(0, v27.Size.Y / 4, 0)) * CFrame.Angles(0, 0, 1.5707963267948966));
- v29.Parent = v1.Things:WaitForChild("Comets");
- p8.Egg = v29;
- SetupEgg(p8);
- end;
- end;
- function RequestData()
- local v30, v31 = v1.Network.Invoke("Comets: Get Data");
- local v32, v33, v34 = pairs(v30);
- while true do
- local v35, v36 = v32(v33, v34);
- if v35 then
- else
- break;
- end;
- v34 = v35;
- SpawnComet(v36, v31[v36.Id][v1.LocalPlayer.UserId]);
- end;
- end;
- function GetCometByCoinId(p9)
- local v37, v38, v39 = pairs(u1);
- while true do
- local v40, v41 = v37(v38, v39);
- if v40 then
- else
- break;
- end;
- v39 = v40;
- if v41.CoinId == p9 then
- return v41;
- end;
- end;
- return nil;
- end;
- v1.Network.Fired("Comets: Announcement"):Connect(function(p10, p11)
- local v42 = v1.Directory.Areas[p10];
- v1.Signal.Fire("Notification", "A Massive Comet will land in " .. v42.name .. " in " .. v1.Functions.FormatTimeShort(p11, false) .. "!", {
- color = Color3.fromRGB(0, 170, 255),
- force = true
- });
- v1.ChatMsg.New("A Massive Comet will land in " .. v42.name .. " in " .. v1.Functions.FormatTimeShort(p11, false) .. "!", Color3.fromRGB(0, 170, 255));
- v1.Shake.Create(5, 0.25, 0.15, true);
- v1.Audio.Play("rbxassetid://12669908963", script, 1, 0.2);
- end);
- v1.Network.Fired("Comets: Spawn Client"):Connect(function(p12)
- SpawnComet(p12, false);
- end);
- v1.Network.Fired("Comets: Massive Broken"):Connect(function(p13)
- local v43 = u1[p13];
- if not v43 or not v43.Coin then
- return;
- end;
- SetupCometEgg(v43);
- v1.Shake.Create(2, 1, 0.3);
- local v44 = v1.Audio.Play("rbxassetid://12669914084", v43.BrokenModel, 1, 0.6);
- v44.RollOffMaxDistance = 800;
- v44.RollOffMinDistance = 300;
- end);
- v1.Network.Fired("Comets: Removed"):Connect(function(p14)
- local v45 = u1[p14];
- if not v45 then
- return;
- end;
- if v45.Model then
- v1.WorldFX.CometDespawn(v45.Model.Position);
- v45.Model:Destroy();
- end;
- if v45.TravelTween then
- v45.TravelTween:Cancel();
- end;
- if v45.Egg then
- v45.Egg:Destroy();
- end;
- if v45.BrokenModel then
- v1.WorldFX.CometDespawn(v45.BrokenModel.Position);
- v45.BrokenModel:Destroy();
- end;
- u1[p14] = nil;
- end);
- v1.Signal.Invoked("Comets: Landed").OnInvoke = function(p15)
- local v46 = GetCometByCoinId(p15);
- if not v46 then
- return nil;
- end;
- return HasLanded(v46);
- end;
- v1.Signal.Fired("World Changed"):Connect(function(p16)
- for v47, v48 in pairs(u1) do
- if v48.WorldId == p16 then
- if not animating then
- CometAnimation(v48);
- end;
- if v48.Destroyed then
- SetupCometEgg(v48);
- end;
- else
- if animating then
- CancelAnimation(v48);
- end;
- if v48.Destroyed then
- RemoveBroken(v48);
- end;
- end;
- end;
- end);
- v1.Signal.Fired("Comets: Setup Breakable"):Connect(function(p17, p18)
- local v49 = GetCometByCoinId(p17);
- if not v49 then
- return;
- end;
- local v50 = HasLanded(v49);
- if v50 then
- local v51 = 0;
- else
- v51 = 1;
- end;
- p18.Transparency = v51;
- for v52, v53 in pairs(p18:WaitForChild("Attachment"):GetChildren()) do
- v53.Enabled = v50;
- end;
- p18:SetAttribute("PreventClick", not v50);
- local l__ClickDetector__54 = p18:FindFirstChild("ClickDetector");
- if l__ClickDetector__54 then
- l__ClickDetector__54.MaxActivationDistance = v50 and v1.Settings.CoinGrabDistance or 0;
- end;
- v49.Coin = p18;
- local v55 = v1.Audio.Play("rbxassetid://12669914691", p18, 1, 0.2, nil, nil, true);
- v55.RollOffMaxDistance = 300;
- v55.RollOffMinDistance = 100;
- end);
- task.spawn(RequestData);
- local u2 = {};
- local u3 = false;
- function SetupEgg(p19)
- if p19 then
- if not p19.Egg then
- return;
- end;
- else
- return;
- end;
- local l__Egg__56 = p19.Egg.Egg;
- local v57, v58 = v1.Interact.Add(l__Egg__56.CFrame.p, {
- label = "Collect",
- dist = 20
- });
- table.insert(u2, v58);
- v57:Connect(function()
- if not u3 then
- u3 = true;
- local v59, v60 = v1.Network.Invoke("Comets: Open Egg", p19.Id);
- if not v59 then
- if v60 then
- v1.Message.New(v60);
- u3 = false;
- return;
- end;
- end;
- p19.Opened = true;
- p19.Egg:Destroy();
- local v61, v62, v63 = ipairs(u2);
- while true do
- v61(v62, v63);
- if v61 then
- else
- break;
- end;
- v63 = v61;
- v62();
- end;
- u2 = {};
- u3 = false;
- end;
- end);
- local u4 = Random.new();
- coroutine.wrap(function()
- local l__CFrame__64 = l__Egg__56.CFrame;
- local v65 = u4:NextNumber(1, 10);
- local v66 = os.clock();
- local v67 = nil;
- while true do
- if l__Egg__56 then
- else
- break;
- end;
- if l__Egg__56.Parent then
- else
- break;
- end;
- if v67 then
- if 2 <= os.clock() - v67 then
- local v68 = v1.LocalPlayer:DistanceFromCharacter(l__Egg__56.CFrame.p);
- if 300 <= v68 then
- wait((math.clamp(v68 / 600, 0.5, 3)));
- else
- v67 = os.clock();
- end;
- end;
- else
- v68 = v1.LocalPlayer:DistanceFromCharacter(l__Egg__56.CFrame.p);
- if 300 <= v68 then
- wait((math.clamp(v68 / 600, 0.5, 3)));
- else
- v67 = os.clock();
- end;
- end;
- local v69 = os.clock() - v66 + v65;
- l__Egg__56.CFrame = l__CFrame__64 * CFrame.new(0, math.sin(v69 * 1) / 2, 0) * CFrame.Angles(0, v69, 0);
- v1.RenderStepped();
- end;
- end)();
- local u5 = false;
- local function u6()
- local v70 = v1.Directory.Eggs["Comet Egg"];
- local v71 = v1.Assets.Billboards.EggInfo:Clone();
- local v72 = v70.drops;
- local l__isGolden__73 = v70.isGolden;
- local v74 = v1.Save.Get();
- if type(v72) == "string" then
- v72 = v1.Directory.Eggs[v72].drops;
- end;
- local v75, v76, v77 = ipairs(v72);
- while true do
- v75(v76, v77);
- if v75 then
- else
- break;
- end;
- v77 = v75;
- local v78 = v76[1];
- local v79 = v1.Directory.Pets[v78];
- local l__rarity__80 = v79.rarity;
- if l__rarity__80 ~= "Secret" then
- if v76[3] then
- if v1.Shared.IsHardcore then
- local v81 = v1.Assets.UI.EggInfo.Pet:Clone();
- v81:SetAttribute("PetId", v78);
- local v82 = 0;
- local v83, v84, v85 = ipairs(v72);
- while true do
- v83(v84, v85);
- if v83 then
- else
- break;
- end;
- v85 = v83;
- v82 = v82 + v84[2];
- end;
- local v86 = v76[2] / v82 * 100;
- v81.Thumbnail.Image = l__isGolden__73 and v79.goldenThumbnail or v79.thumbnail;
- v81.LayoutOrder = 9999 - v86;
- if v74.AutoDelete[v79.rarity] then
- v81.DeleteImage.Visible = true;
- else
- v81.DeleteImage.Visible = false;
- end;
- if l__rarity__80 ~= "Legendary" then
- if l__rarity__80 ~= "Mythical" then
- if l__rarity__80 ~= "Event" then
- if l__rarity__80 ~= "Exclusive" then
- if v86 <= 0.0099 then
- v81.Thumbnail.Chance.Text = "??";
- v1.GUIFX.Rainbow(v81.Thumbnail.Chance, "TextColor3");
- else
- local v87, v88, v89 = Color3.toHSV((Color3.fromRGB(49, 255, 39):Lerp(Color3.fromRGB(255, 75, 39), (math.clamp(94.2467 * math.pow(0.9315, v86) / 100, 0, 1)))));
- v81.Thumbnail.Chance.TextColor3 = Color3.fromHSV(v87, v88, v89 * 2);
- v81.Thumbnail.Chance.Text = v1.Functions.FormatChance(v86 / 100);
- end;
- else
- v81.Thumbnail.Chance.Text = "??";
- v1.GUIFX.Rainbow(v81.Thumbnail.Chance, "TextColor3");
- end;
- else
- v81.Thumbnail.Chance.Text = "??";
- v1.GUIFX.Rainbow(v81.Thumbnail.Chance, "TextColor3");
- end;
- else
- v81.Thumbnail.Chance.Text = "??";
- v1.GUIFX.Rainbow(v81.Thumbnail.Chance, "TextColor3");
- end;
- else
- v81.Thumbnail.Chance.Text = "??";
- v1.GUIFX.Rainbow(v81.Thumbnail.Chance, "TextColor3");
- end;
- if v79.titanic then
- v81.TitanicCrown.Visible = true;
- end;
- v81.Thumbnail.Position = UDim2.new(0, 0, 1, 0);
- v81.Thumbnail.ImageTransparency = 1;
- v1.Functions.Tween(v81.Thumbnail, {
- Position = UDim2.new(0, 0, 0, 0),
- ImageTransparency = 0
- }, { 0.45 + v75 / 9 / 3, Enum.EasingStyle.Quart, Enum.EasingDirection.Out });
- v81.Parent = v71.Frame.Pets;
- end;
- else
- v81 = v1.Assets.UI.EggInfo.Pet:Clone();
- v81:SetAttribute("PetId", v78);
- v82 = 0;
- v83, v84, v85 = ipairs(v72);
- while true do
- v83(v84, v85);
- if v83 then
- else
- break;
- end;
- v85 = v83;
- v82 = v82 + v84[2];
- end;
- v86 = v76[2] / v82 * 100;
- v81.Thumbnail.Image = l__isGolden__73 and v79.goldenThumbnail or v79.thumbnail;
- v81.LayoutOrder = 9999 - v86;
- if v74.AutoDelete[v79.rarity] then
- v81.DeleteImage.Visible = true;
- else
- v81.DeleteImage.Visible = false;
- end;
- if l__rarity__80 ~= "Legendary" then
- if l__rarity__80 ~= "Mythical" then
- if l__rarity__80 ~= "Event" then
- if l__rarity__80 ~= "Exclusive" then
- if v86 <= 0.0099 then
- v81.Thumbnail.Chance.Text = "??";
- v1.GUIFX.Rainbow(v81.Thumbnail.Chance, "TextColor3");
- else
- v87, v88, v89 = Color3.toHSV((Color3.fromRGB(49, 255, 39):Lerp(Color3.fromRGB(255, 75, 39), (math.clamp(94.2467 * math.pow(0.9315, v86) / 100, 0, 1)))));
- v81.Thumbnail.Chance.TextColor3 = Color3.fromHSV(v87, v88, v89 * 2);
- v81.Thumbnail.Chance.Text = v1.Functions.FormatChance(v86 / 100);
- end;
- else
- v81.Thumbnail.Chance.Text = "??";
- v1.GUIFX.Rainbow(v81.Thumbnail.Chance, "TextColor3");
- end;
- else
- v81.Thumbnail.Chance.Text = "??";
- v1.GUIFX.Rainbow(v81.Thumbnail.Chance, "TextColor3");
- end;
- else
- v81.Thumbnail.Chance.Text = "??";
- v1.GUIFX.Rainbow(v81.Thumbnail.Chance, "TextColor3");
- end;
- else
- v81.Thumbnail.Chance.Text = "??";
- v1.GUIFX.Rainbow(v81.Thumbnail.Chance, "TextColor3");
- end;
- if v79.titanic then
- v81.TitanicCrown.Visible = true;
- end;
- v81.Thumbnail.Position = UDim2.new(0, 0, 1, 0);
- v81.Thumbnail.ImageTransparency = 1;
- v1.Functions.Tween(v81.Thumbnail, {
- Position = UDim2.new(0, 0, 0, 0),
- ImageTransparency = 0
- }, { 0.45 + v75 / 9 / 3, Enum.EasingStyle.Quart, Enum.EasingDirection.Out });
- v81.Parent = v71.Frame.Pets;
- end;
- end;
- end;
- v71.Size = UDim2.new(0, 0, 0, 0);
- v71.StudsOffset = Vector3.new(0, 4, 0);
- v1.Functions.Tween(v71, {
- Size = UDim2.new(10, 0, 10, 0),
- StudsOffset = Vector3.new(0, 10, 0)
- }, { 0.2, Enum.EasingStyle.Quad, Enum.EasingDirection.Out });
- v71.Frame.Pets:FindFirstChild("UIGridLayout"):ApplyLayout();
- v71.Parent = l__Egg__56;
- end;
- local function u7()
- local l__EggInfo__90 = l__Egg__56:FindFirstChild("EggInfo");
- if l__EggInfo__90 then
- v1.Functions.Tween(l__EggInfo__90, {
- Size = UDim2.new(0, 0, 0, 0),
- StudsOffset = Vector3.new(0, 4, 0)
- }, { 0.15, Enum.EasingStyle.Quad, Enum.EasingDirection.In }).Completed:Connect(function()
- l__EggInfo__90:Destroy();
- end);
- end;
- end;
- coroutine.wrap(function()
- local v91 = v1.Save.Get();
- while true do
- if p19.Egg then
- else
- break;
- end;
- if p19.Egg.Parent then
- else
- break;
- end;
- if p19.Egg:FindFirstChild("Egg") then
- else
- break;
- end;
- if l__Egg__56 then
- local v92 = v1.LocalPlayer:DistanceFromCharacter(l__Egg__56.CFrame.p) or 999;
- else
- v92 = 999;
- end;
- local v93 = v92 <= 20;
- local l__EggInfo__94 = l__Egg__56:FindFirstChild("EggInfo");
- if v93 then
- if not u5 then
- u5 = true;
- u6();
- elseif u5 then
- if not v93 then
- u5 = false;
- u7();
- end;
- end;
- elseif u5 then
- if not v93 then
- u5 = false;
- u7();
- end;
- end;
- v1.Heartbeat(5);
- end;
- end)();
- end;
- task.spawn(function()
- local u8 = 0;
- v1.RunService.Heartbeat:Connect(function(p20)
- u8 = u8 + p20;
- if u8 > 1 then
- u8 = u8 - 1;
- for v95, v96 in pairs(u1) do
- if v96.Type == "Massive Comet" and not v96.LandSound and HasLanded(v96) then
- local v97 = v1.Save.Get();
- if v97 and v97.World ~= v96.WorldId then
- v96.LandSound = true;
- v1.Shake.Create(2, 0.2, 0.3);
- v1.Audio.Play("rbxassetid://12669913959", script, 1, 0.4);
- end;
- end;
- end;
- end;
- end);
- end);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement