Ad
Still have questions? Join our Discord server and get real time help.
Log in to vote
0

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

Asked by 3 years ago
Edited 3 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 — 3y

1 answer

Log in to vote
3
Answered by 3 years ago
Edited 3 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 — 3y
Ad

Answer this question