This is a tp commmand but it dont tp to the person you mention


local groupid = 8972210
local minrank = 100




game.Players.PlayerAdded:Connect(function(player)
	player.CharacterAdded:Connect(function(char)
		if player:GetRankInGroup(groupid) >= minrank then
			player.Chatted:Connect(function(msg, recipient)
				if string.sub(msg, 1, 1) == ":" then
					print("False Command")
					local splitString = string.split(msg, " ")
					if splitString[1] == ":to" then
						print("Teleporting ".. splitString[2])
						player.Character.HumanoidRootPart.CFrame = CFrame.new:FindFirstChild(splitString[2])
					end
				end
			end)
		end
	end)
end)

Think it’s something in the variables. Change that to:


local groupid = “8972210”
local minrank = “100”

It dont work, peter.

Variables can’t be in inverted commas, they should stay as:

local groupId = 1234567
local RequiredRank = 255

No, that’d break. You can’t compare strings.

You can’t find a child of CFrame. Try to find the player and then use their character.

Oh, really? Sorry I got this wrong, didn’t mean to inconvenience anyone.

This is what I put and it dont work at all

local groupid = 8972210
local minrank = 100




game.Players.PlayerAdded:Connect(function(player)
	player.CharacterAdded:Connect(function(char)
		if player:GetRankInGroup(groupid) >= minrank then
			player.Chatted:Connect(function(msg, recipient)
				if string.sub(msg, 1, 1) == ":" then
					print("False Command")
					local splitString = string.split(msg, " ")
					if splitString[1] == ":to" then
						print("Teleporting ".. splitString[2])
						player.Character.HumanoidRootPart.CFrame = CFrame.new(splitString[2])
					end
				end
			end)
		end
	end)
end)

If have to change CFrame.new(splitString[2]) To something different just huh… and I try to put CFrame.new([game.Players(splitString[2]) And also dont work, if you could help.

CFrame.new(game.Players:FindFirstChild(splitString[2))

Nope, It dont go at all.

Sorry, try this: game.Players:FindFirstChild(splitString[2]).Charatcer.HumanoidRootPart.CFrame
You don’t need the new CFrame because the CFrame comes from another item.

You have to set the CFrame…

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.