Help with teleport command

I would like my teleport script to work.

So I need t put Player.CFrame or Player.Character.CFrame ?
Here’s a screenshot
image

Thank you for helping in advance.

local player = game:GetService('Players').LocalPlayer
local Admins = {"JAJA_MAM", "Sans_SwapSwapYT"}
player.Chatted:Connect(function(msg)
	local command = "/teleport "
	local CheckIfCoammand = string.sub(msg, 1, 11)


	for _, currentAdmins in pairs(Admins) do
		if player.Name == currentAdmins then
			if string.match(command, CheckIfCoammand) then
				local Victim = string.sub(msg, 12, #msg)
				player.CFrame = game.Workspace:WaitForChild(Victim).CFrame
			end
		end
	end
end)

If its player.CFrame then I don’t have anyone which I can test my script.

1 Like

The player is an object that holds the player lol. There is no CFrame value within the player itself

You can move the players Character by setting the HumanoidRootParts CFrame

local char = player.Character or player.CharacterAdded:Wait()
local HRP = char.HumanoidRootPart

HRP.CFrame = Victim.Character.HumanoidRootPart.CFrame * CFrame.new(0,0,2) --Can edit this to you liking, this just makes sure the player isnt teleported at the exact position.

-----------------
--Assuming "Victim" is another player object
3 Likes