HI I want to clone and move a model to a another objects position but I have been unable to get the script to teleport my object, there are no errors reported when the script is ran. I have tried MoveTo(), SetPrimaryPartCFrame() but they haven’t worked, I have also looked around the dev forum but all the answers I found did not work.
the local script is attempting to clone a model and spawn it at another part’s cframe when a button is clicked
local Top = script.Parent.Parent
local Other = script.Parent.Parent.Parent
local TowerSpawn = workspace:WaitForChild("Tower").CFrame.Position
local Build = workspace.Exploadables.Ready.CobbleTower:Clone()
script.Parent.MouseButton1Click:Connect(function()
Top.Green.Enabled = true Top.Red.Enabled = false
Build:SetPrimaryPartCFrame(CFrame.new(TowerSpawn))
if workspace:FindFirstChild("LightHouse") then
workspace:FindFirstChild("LightHouse"):Destroy()
end
if workspace:FindFirstChild("CassicHouse") then
workspace:FindFirstChild("ClassicHouse"):Destroy()
end
end)
Other.LightHouse.Play.MouseButton1Click:Connect(function()
Top.Green.Enabled = false Top.Red.Enabled = true
end)
Other.HappyHouse.Play.MouseButton1Click:Connect(function()
Top.Green.Enabled = false Top.Red.Enabled = true
end)