So that if the Player walks over it then they Teleport there.
Also I can't find a Good Rbx Lua Tutorial Site
function onTouched(hit) local player = game.Players:GetPlayerFromCharacter(hit.Parent) if player then game:GetService("TeleportService"):TeleportToSpawnByName("SpawnLocation1", player) end end script.Parent.Touched:connect(onTouched)
This is the Code ..
I want to have many different teleport to different areas .
You can do this without scripting. (just like 2011!)
Put down a team spawn
go into settings and make: team change on touch
Bam! when a player steps on it they will spawn there!
I hope this helps.
Use :MoveTo
. TeleportService
is to teleport to DIFFERENT GAMES.
Use a LocalScript for this one...
player = game.Players.LocalPlayer Part = Workspace.SpawnLocation1 script.Parent.Touched:connect(function player:MoveTo(Part.Position, Part) --Moves the player to "Part"s Position end)