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

What do I need to change to teleport from 1 part to another?

Asked by 7 years ago
Edited 7 years ago

--TheBoySurvivor

script.Parent.Touched:Connect(function(t)

if t.parent and t.parent:FindFirstChild("torso") then

t.Parent:MoveTo(workspace.B.Position)

end

end)

0
You have "torso" used with improper grammar. Coding languages are case sensitive. Change "torso" to "Torso" and you should should be golden. iDev_Percy 45 — 7y

1 answer

Log in to vote
3
Answered by 7 years ago
Edited 7 years ago

Lua is case sensitive

Use connect, not Connect, use .Parent, not .parent, and look for Torso, not torso.

script.Parent.Touched:connect(function(t)
    if t.Parent:FindFirstChild("Torso") then
        t.Parent:MoveTo(workspace.B.Position)
    end
end)

Good Luck

If I helped, please don't forget to accept my answer.
1
Just like C++ is semicolon sensitive,I always spend hours trying to find that ONE uncapitalized letter. Reshiram110 147 — 7y
Ad

Answer this question