Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

Script isnt Teleporting players in Round System?

So I have a Lobby and Playing team and i would like the players in the Lobby team to teleport to the map and also set their team to the Playing team and vice versa when the game ends, but it doesn't seem to work and the output doesn't have any errors.

My Script:

	local playersinlobby = lobbyteam:GetPlayers()

	for i, v in pairs(playersinlobby) do

		local Character = v.Character

		local HumanoidRootPart = Character:WaitForChild("HumanoidRootPart")

		if Character then
			HumanoidRootPart.CFrame = ClonedMap.TeleportPoint.CFrame

		wait(2)


			v.Team = playingteam

end
	end 

I would like to know the reason why.

Thanks.

3 comments

0

It looks fine to me, does anything happen at all?

0

Try doing HumanoidRootPart.CFrame = CFrame.new(ClonedMap.TeleportPoint.Position)

0

sorry for making you wait but yes everything works except the teleporting parts i could send the whole script if needed

2 answers

Also try doing

Character:SetPrimaryPartCFrame(CFrame.new(ClonedMap.TeleportPoint.Position))

Try using this

Character:MoveTo(Vector3.new(0,0,0)) -- change the pos to ur teleport points location

2 comments

0

I would but I dont know or wouldnt be able to make it with multiple maps that are chosen randomly cuz that how my script works i can send the whole script if that helps.

0

If you want to I could look at the whole script, but there's a value called a Vector3 value that you can use to store the map position and turn it into a variable.

This discussion is preserved as it was. New answers, comments, and votes are closed.