HowToRoblox

HatchEffects

Aug 7th, 2020
1,424
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.91 KB | None | 0 0
  1. local re = workspace.EggIncubator.HatchRE
  2.  
  3. local egg = workspace.EggIncubator.Egg
  4.  
  5. local eggShakeFolder = workspace.EggIncubator.EggShakeFrames
  6.  
  7.  
  8. re.OnClientEvent:Connect(function(chosenPet, rarityColour)
  9.    
  10.     for i = 1, #eggShakeFolder:GetChildren() do
  11.        
  12.         game.TweenService:Create(egg, TweenInfo.new(0.2, Enum.EasingStyle.Bounce, Enum.EasingDirection.InOut), {CFrame = eggShakeFolder:GetChildren()[i].CFrame}):Play()
  13.         wait(0.2)
  14.     end
  15.    
  16.     egg.Transparency = 1
  17.    
  18.    
  19.     egg.HatchedPetInfo.PetName.Text = chosenPet.Name
  20.     egg.HatchedPetInfo.PetRarity.Text = chosenPet.Rarity.Value
  21.    
  22.     egg.HatchedPetInfo.PetRarity.TextColor3 = rarityColour
  23.    
  24.     egg.HatchedPetInfo.Enabled = true
  25.    
  26.    
  27.     local petClone = chosenPet:Clone()
  28.     petClone.CFrame = egg.CFrame
  29.    
  30.     petClone.Parent = workspace
  31.    
  32.    
  33.     re:FireServer()
  34.    
  35.    
  36.     wait(2)
  37.    
  38.    
  39.     egg.HatchedPetInfo.Enabled = false
  40.     egg.Transparency = 0
  41.     petClone:Destroy()
  42. end)
Add Comment
Please, Sign In to add comment