This does not work as my script output starts looking for everything in House1 and House2. Those are both models by the way.
local button = workspace.place local teleport = workspace.TP.Head local back = workspace.back.Head function onClick() game.workspace.House1:Destroy() game.workspace.House2:Destroy() teleport.Enabled.Value = '1' game.ReplicatedFirst.House1:Clone(Vector3.new(-16.4,2.47,-59.5)) back.Enabled.Value = '0' end button.ClickDetector.MouseClick:connect(onClick) function onTouch(part) wait(1) teleport.Enabled.Value = '0' wait(20) back.Enabled.Value = '1' wait(1) end teleport.Touched:connect(onTouch)
Problem 1
House1 and House2 may not exist, so do this instead:
local h1 = game.Workspace:FindFirstChild("House1") -- put these in the function local h2 = game.Workspace:FindFirstChild("House2") if h1 then h1:Destroy() end if h2 then h2:Destroy() end
Problem 2
Clone cannot have anything in the parameters and you are not setting it's parent.
Do this instead:
local c = game.ReplicatedStorage.House1:Clone() c.Parent = game.Workspace c.Position = Vector3.new(x,y,z)