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

Why doesn't my script for teleporting objects work (for my tycoon)?

Asked by 7 years ago
Edited 7 years ago

I am making a tycoon right, and this is supposed to teleport a drop once it hits the pad ( which is what the script is under ) and teleport it to the area listed in the script? Can someone help me?

script.Parent.Touched:connect(function(hit)
    if hit.Parent:FindFirstChild("part") then
        hit.Parent.part.CFrame = CFrame.new(-189.706, 2.003, -183.431)
    else print("You're not a drop silly!")
end)

edit: its also giving me this error unexpected symbol near ')'

0
Use vector3.New DrPredablox 153 — 7y
0
it's still giving me this error unexpected symbol near ')' MateeTheGod 0 — 7y

1 answer

Log in to vote
0
Answered by 7 years ago
script.Parent.Touched:connect(function(h)
    if (h.Parent.Name == "part") then
        h.Parent:MoveTo(Vector3.new(-189.706, 2.003, -183.431))
    end
end) 
0
Urm this isn't the correct anwser, he is making a tycoon. He has to use cframe, if he used just vector, everyone would go to the same position if they touched the part AyeJude 41 — 7y
Ad

Answer this question