I am trying to get a team to teleport onto the map, And i as the round start the players stays in lobby.

Perhaps CFrame isn't the wise thing to use for player to move them towards spawns?

Any help would be really appeciated as How may i achieve moving a player successfuly?

function myGame:OnCharacterAdded(character, newPlayer)
	local thisHumanoid = waitForChild(character, "Humanoid")
	
	thisHumanoid.Died:connect(function() 
		myGame:CountScore(thisHumanoid) 
	end)
	
	
	myGame:DressPlayerCharacter(character, newPlayer.TeamColor, newPlayer) -- Dress this guy! 
	
	local thisTorso = waitForChild(character, "Torso")
	local teamColor = tostring(newPlayer.TeamColor)
	if newPlayer and newPlayer:FindFirstChild("ShowIntro") and newPlayer.ShowIntro.Value == true then 
		-- Do nothing, we are showing him intro, otherwise teleport him
	else
		if teamColor == "Bright blue" then 	
			local bCh = myGame.BlueSpawnParts_Model:GetChildren() 
			--Character.Torso.CFrame = CFrame.new(Vector3.new(location.Position.x,location.Position.y + 3,location.Position.z))
			local eww = bCh[math.random(1, #bCh)].CFrame + Vector3.new(0, 5, 0)
			while thisTorso.CFrame ~= CFrame.new(eww.p) do 
				thisTorso.CFrame = CFrame.new(eww.p)
				wait()
			end 
		else						
			local rCh = myGame.RedSpawnParts_Model:GetChildren()
			local eww = rCh[math.random(1, #rCh)].CFrame + Vector3.new(0, 5, 0)
			while thisTorso.CFrame ~= CFrame.new(eww.p) do 
				thisTorso.CFrame = CFrame.new(eww.p) 
				wait()
		end 
	end 
end

3 comments

0

Can you provide the whole script?

0

Yea we can't see all the variable's from just that piece of code.

0

I added the entire Function code if that may help?