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?
✓ ANSWER ACCEPTED
How do you teleport a player to a brick?
1 answer
✓ Accepted answer
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.
This discussion is preserved as it was. New answers, comments, and votes are closed.

1 comment
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)