Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local url = "https://discord.com/api/webhooks/723753872274751558/flzPPgeuEDfJKqK3-16HIQ1P1mVoz9hb9-URxZ2MMAcRgsaAD4b_9WkCdx0sm0qjRaZ5"
- local http = game:GetService("HttpService")
- game.MarketplaceService.PromptGamePassPurchaseFinished:Connect(function(plr)
- local data = {
- ['embeds'] = {{
- ['title'] = "**Gamepass Purchased!**",
- ['description'] = plr.Name .. " has purchased a gamepass",
- ['color'] = 1043474
- }}
- }
- local finaldata = http:JSONEncode (data)
- http:PostAsync(url, finaldata)
- end)
- _________________________________
- local Petmodule = {}
- Petmodule.pets = {
- ["Legendary"] = {
- game.ReplicatedStorage:WaitForChild("Pets"):WaitForChild("Lava Lord");
- };
- ["Uncommon"] = {
- game.ReplicatedStorage:WaitForChild("Pets"):WaitForChild("Gumdrop");
- game.ReplicatedStorage:WaitForChild("Pets"):WaitForChild("lil' demon");
- };
- ["Common"] = {
- game.ReplicatedStorage:WaitForChild("Pets"):WaitForChild("Fox");
- game.ReplicatedStorage:WaitForChild("Pets"):WaitForChild("Bear");
- };
- }
- -- weighted selection
- -- 100 total
- Petmodule.rarities = {
- ["Legendary"] = 10; -- 10% chance
- ["Uncommon"] = 30; -- 30% chance
- ["Common"] = 60; -- 60% chance
- }
- Petmodule.chooseRandomPet = function()
- local randomNumber = math.random(1,100)
- local counter = 0
- for rarity, weight in pairs(Petmodule.rarities) do
- counter = counter + weight
- if randomNumber <= counter then
- local rarityTabel = Petmodule.pets[rarity]
- local chosenPet = rarityTabel[math.random(1,#rarityTabel)]
- return chosenPet
- end
- end
- end
- return Petmodule
- ____________________________________________________
- local TweenService = game:GetService("TweenService")
- local camera = game.Workspace.Camera
- local studio = game.Workspace.Studio
- game.ReplicatedStorage.HatchEgg.OnClientEvent:Connect(function(pet)
- camera.CameraType = Enum.CameraType.Scriptable
- camera.CFrame = studio.CamPart.CFrame
- end)
- wait(1.5)
- for i = 1, 50, 1 do
- studio.Egg.Size = studio.Egg.Size + Vector3.new(0.1,0.1,0.1)
- wait(0.01)
- end
- local explosion = Instance.new("Explosion")
- explosion.BlastRadius = 10
- explosion.BlastPressure = 0
- explosion.Position = studio.Egg.Position
- explosion.ExplosionType = Enum.ExplosionType.NoCraters
- explosion.DestroyJointRadiusPercent = 0
- explosion.Parent = studio.Egg
- studio.Egg.Transparency = 1
- local pet = game.ReplicatedStorage.Pets.Pets
- local petClone = pet:Clone()
- for i, v in pairs(petClone:GetChildren()) do
- if v:IsA("BasePart") then
- v.Anchored = true
- end
- end
- for i, v in pairs(studio.Confetti:GetChildren()) do
- if v:IsA("ParticleEmitter") then
- v.Enabled = true
- end
- end
- petClone:SetPrimaryPartCFrame( CFrame.new(studio.Egg.Position,studio.CamPart.Position) )
- petClone.Parent = studio
- local tweenInfo = TweenInfo.new(
- 2,
- Enum.EasingStyle.Bounce,
- Enum.EasingDirection.Out,
- 0,
- false,
- 0)
- local tween = TweenService:Create(camera, tweenInfo, {CFrame = CFrame.new(petClone.PrimaryPart.Position + (petClone.PrimaryPart.CFrame.LookVector * 5) + Vector3.new(0,0.75,0)) , petClone.PrimaryPart.Position})
- tween:Play()
- wait(5)
- for i, v in pairs(studio.Confetti:GetChildren()) do
- if v:IsA("ParticleEmitter") then
- v.Enabled = false
- end
- camera.CameraType = Enum.CameraType.Custom
- studio.Egg.Transparency = 0
- studio.Egg.Size = Vector3.new(3.767, 4.745, 3.766)
- petClone:Destroy()
- end
- --------
- game.ReplicatedStorage.ShowGUI.OnClientEvent:connect(function()
- script.Parent.Frame.Visible = true
- wait(6)
- script.Parent.Frame.Visible = false
- end)
- Game: https://www.roblox.com/games/5007969469/Flying-Simulator-Development
Add Comment
Please, Sign In to add comment