So I have a script that choses an option that has a set probability of being chosen and then prints what it chose. My question is how can I make that script clone the item it choses. Example: I am the script is for an egg that will hatch into a dinosaur, right now it choses the dinosaur name but how can I make it put that dinosaur into the game. I assume I should put what its choosing like so
local Dilo = game.ServerStorage.Dilophosaurus
but I'm not sure exactly how to make it clone that dino. Would I have to put that dino in the location I want it and then move it to Serverstorage or Lighting?
Heres my current probability script in the egg.
local random=math.random(0,100)
local randomchoice
if random <= 15 then
randomchoice = "Dilo" --15%
print ("Dilophosaurus Hatched!")
elseif random <= 40 and random >= 15 then --25%
randomchoice = "Pachy"
print ("Pachy Hatched!")
elseif random <= 55 and random >= 40 then --15%
randomchoice = "Trike"
print ("Triceratops Hatched!")
elseif random <= 70 and random >= 55 then --15%
randomchoice = "Coeluro"
print ("Coelurosaur Hatched!")
elseif random <= 100 and random >= 70 then --30%
randomchoice = "Compy"
print ("Compy Hatched!")
end
Any help on how this can work is greatly appreciated thanks ahead!

4 comments
Sorta. You should be able to do "local Dilo = game.ServerStorage.Dilophosaurus:Clone()" followed by "Dilo.Parent = workspace" if you want the clone to be put into the game (which is what I'm assuming).
ok first things first, the location, it's best to place it in replicated storage or server storage
There is no reason to store objects in Lighting. Lighting is used for skyboxes, post effects, and environmental lighting. I don't think a "dilophosaurus" is a skybox or post effect.
lol ok I will put them in server storage