Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How would I fix this time travel script?

Asked by 9 years ago

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)
0
YOU FIGURED OUT HOW TO WRITE A TIME TRAVELING SCRIPT!? OMG! Validark 1580 — 9y

1 answer

Log in to vote
1
Answered by 9 years ago

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)
Ad

Answer this question