#How to spawn model

1 messages · Page 1 of 1 (latest)

dusky sorrel
#

This is my code and someone could explain me how to spawn a model with parts ?


local crownTemplate = game.ReplicatedStorage:FindFirstChild("Crown")

local dropperPartsFolder = tycoon:FindFirstChild("DropperParts")

local dropColorValue = tycoon:FindFirstChild("Values").DropColorValue

local materialValue = tycoon:FindFirstChild("Values").MaterialValue

local billboardGuiCrown = game.ReplicatedStorage:FindFirstChild("BillboardGuiCrown")

local moneyValue = tycoon:FindFirstChild("Values").MoneyValue

while wait(3) do
    local cloneGui = billboardGuiCrown:Clone()
    local part = crownTemplate:Clone()
    part.BrickColor = dropColorValue.Value
    part.Material = materialValue.Value
    part.Name = "Crown"
    part.Parent = dropperPartsFolder
    part.CFrame = script.Parent.Spawner.CFrame
    
    local cashValue = Instance.new("IntValue", part)
    cashValue.Value = 20
    cashValue.Name = "CashValue"
    
    cloneGui.Parent = part
    cloneGui.Frame.TextLabel.Text = "$"..cashValue.Value
    
    game.Debris:AddItem(part,15)
    
end```
In my Crown model I have 6 parts
twilit rampart
#

Thingyouwanttospawn:clone()

#

Actually wait

#

Clone = modelname:clone()
clone.position = wherever you want it to go
Maybe instead of position you should do pivotto()

feral token
#

If it is the case make sure to have PrimaryPart set in the model properties

twilit rampart
feral token
#

PivoteTo is for model

#

The old :SetPrimaryPartCFrame is deprecated

twilit rampart
#

Oooh