-
What do you want to achieve? I want to fix the error and to show the egg.
-
What is the issue?
-
What solutions have you tried so far? I tried to change the script, nothing works.
Script:
local TweenService = game:GetService("TweenService")
local camera = game.Workspace.Camera
local ClassicEggStudio = game.Workspace:WaitForChild("ClassicEggStudio")
game.ReplicatedStorage.HatchEgg.OnClientEvent:Connect(function(pet)
camera.CameraType = Enum.CameraType.Scriptable
camera.CFrame = game.Workspace.CurrentCamera.CFrame
wait(1.5)
for i = 1, 50, 1 do
ClassicEggStudio.ClassicEgg.Size = ClassicEggStudio.ClassicEgg.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 = ClassicEggStudio.ClassicEgg.Position
explosion.ExplosionType = Enum.ExplosionType.NoCraters
explosion.DestroyJointRadiusPercent = 0
explosion.Parent = ClassicEggStudio.ClassicEgg
ClassicEggStudio.ClassicEgg.Transparency = 1
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(ClassicEggStudio.Confetti:GetChildren()) do
if v:IsA("ParticleEmitter") then
v.Enabled = true
end
end
petClone:SetPrimaryPartCFrame( CFrame.new(ClassicEggStudio.ClassicEgg.Position,ClassicEggStudio.CamPart.Position) )
1. List item
petClone.Parent = ClassicEggStudio
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(ClassicEggStudio.Confetti:GetChildren()) do
if v:IsA("ParticleEmitter") then
v.Enabled = false
end
end
camera.CameraType = Enum.CameraType.Custom
ClassicEggStudio.ClassicEgg.Transparency = 0
ClassicEggStudio.ClassigEgg.Size = Vector3.new(-169.043, -375.934, 205.755)
petClone:Destroy()
end)