Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

Why does this script teleport to a random place?

Hello, I am trying to do a teleport script for a game that teleports to coins one by one. It doesn't really work, instead of doing that it teleports to a random place on the map. It does it for every game:

for i,v in pairs(game:GetChildren()) do
   game.Players.LocalPlayer.Character:MoveTo(Vector3.new(game.Workspace.GameObjects.Credit.Position))

end

yeah script is broken at the end. just teleports to a random place, like I said

2 comments

0

full thing is there just click view source

0

Depends on where credit is located.

1 answer

✓ Accepted answer

You may just use this:

game.Players.LocalPlayer.Character:MoveTo(game.Workspace.GameObjects.Credit.Position + Vector3.new(0,5,0))

The last bit I added is to make sure you don't tp into it so it pushes you away. It is not necessary if the coin doesn't have collision. I don't know what you were trying to do with the for loop, but this is how you would teleport. ^^

This discussion is preserved as it was. New answers, comments, and votes are closed.