So, I have a brick with a script in it, we'll refer to it as Brick1. The script:
Comic explaining what i mean due request http://prntscr.com/7y36ah
--Stuff about determining what spawnedLoot is which is irrelevant local spawnedLoot = game.ReplicatedStorage.Loot[choice]:Clone() spawnedLoot.Parent = workspace spawnedLoot:SetPrimaryPartCFrame(script.Parent.CFrame) <--------------- script:Destroy()
Which works as expected, when I start the game spawnedLoot spawns as expected.
Now for my game i'm going to need to clone this brick, so I copied it to ReplicatedStorage and in-game, used another script to make a clone of it (the one in repstorage). We'll refer to this as Brick2.
Brick2's script DOES work perfectly, with one thing... instead of it's spawnedLoot's position being at Brick2, it's at Brick1. I have NO idea how this could possibly happen, so could someone with more experience with cloning help me out here?
From the looks of it, you already know what the problem is:
spawnedLoot:SetPrimaryPartCFrame(script.Parent.CFrame)
More specifically;
script.Parent.CFrame
The issue is you are setting the position of Brick2 to the position of the parent of the script.