Spawn model on a specific bricks location

I am trying to make a model located in Replicated Storage spawn in the position of the brick called NukeFires But it says That the model does not have a position. How can i do fix this?
here is the script:

local n = game.ReplicatedStorage.FatMan:Clone()
n.Position = workspace.NukeFires.Position

1 Like

The model itself, doesn’t have a property named as ā€œPositionā€, for this, you’ll need to set a PrimaryPart in the model then use a function called SetPrimaryPartCFrame(), then include the CFrame of the part you want the model to be teleported to inside between the brackets.

2 Likes

how could I do that? What would the code look like?

I would place a part inside the model and set the primary part of the model equal to that part. Then you can change the model’s position by referencing that primary part.

Please do not copy my code, this is just an example.

First, go to our model and look at its properties, then click the empty area of the PrimaryPart, then select any part that’s close to the middle of the model by left clicking while your cursor icon is like a part shape.

Then your code will be like this:

game:GetService("ReplicatedStorage").Model:Clone():SetPrimaryPartCFrame(part.CFrame)
1 Like

ive tried this:

local PrimePart = game.ReplicatedStorage.FatMan.PrimePart
local n = game.ReplicatedStorage.FatMan:Clone():SetPrimaryPartCFrame(PrimePart.CFrame)
n.Position = workspace.NukeFires.Position

but it won’t work still. it says:

attempt to index nil with ā€˜Position’

You literally did it wrong, why are you setting the position again after doing it?

Just make a reference to the model, and then make a clone, then use :SetPrimaryPartCFrame(part.Position)

its because i want it to spawn the model to spawn in the Brickpart called Nukefires Position

You already did it, just to avoid any more arguments, just copy this code but PLEASE understand how it works.

local n = game:GetService(ā€œReplicatedStorageā€).FatMan
local NukeFires = workspace.NukeFires

n:Clone():SetPrimaryPartCFrame(NukeFires.Position)
2 Likes