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

How do you teleport a player to a brick?

Asked by 5 years ago

I want to make a thing so if a certain player says a command it teleports the specified player to the specified model anybody know how?

1
function onTouch(hit) local p = game.Players:GetPlayerFromCharacter(hit.Parent) if p ~= nil then p.Character.Humanoid.Torso.CFrame = CFrame.new(1199.25, 7.5, 93.25) end end script.Parent.Touched:connect(onTouch) ReallyUnikatni 68 — 5y

1 answer

Log in to vote
0
Answered by 5 years ago
Edited 5 years ago
 local function Run ( ChatService, player )
     local function createPart ( speakerName , message , channelName )
         if string.sub ( message , 1 , 5 ) == "teleport" then
             local newPart = Instance.new ( "Part" )
             newPart.Parent = game.Workspace
             player.Character.HumanoidRootPart.CFrame = CFrame.new(newPart.Position.CFrame)
         end
         return false
     end

     ChatService : RegisterProcessCommandsFunction ( "createPart" , createPart )
 end

 return Run 

I'm pretty sure that this will work.

Ad

Answer this question