Hey, I'm making an egg hunt and i'm trying to give the egg a separate model so the egg radar can track it, but when the egg spawns, they all spawn in this one model. How do I make separate models for the egg to spawn in separately? Thanks.
while true do if script.Parent.Health == 0 then local model = Instance.new("Model") model.Parent = game.workspace:WaitForChild("Eggs") s = game.Lighting.Eggs.EgglessShadow.Object.ChocolateEgg:Clone() s.Parent = game.workspace:WaitForChild("Eggs").Model s.CFrame = script.Parent.Parent.UpperTorso.CFrame script:Remove() end wait() end
Change line 9 to be s.Parent = model
. Since all the models have the same name, performing ".Model" on line 9 just gets the first one.
Other notes:
WaitForChild
more than once for a single childworkspace
or game.Workspace
(game.workspace is deprecated)UpperTorso
unless you force all players to use the new character models. The old models have a Torso
, but no UpperTorso
. Both have a HumanoidRootPart
, which I believe is in the same position as the torso.