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

Players won't teleport from lobby to the map?

Hello, I’m wondering if anyone can help me…

I have been trying to make a game using the Mad Bloxxer kit. At first everyone spawns to the map however after saving and returning to edit the game they won’t spawn and stay at the lobby. This is the warning (First Line)…. 14:57:45.894 - Infinite yield possible on 'Workspace.Player1:WaitForChild("Torso")' 14:57:45.895 - Stack Begin 14:57:45.896 - Script 'ServerScriptService.MainScript', Line 333 14:57:45.897 - Stack End

Here is the script showing line 333 where it could possibly be the issue?

--teleport contestants
local spawnsmodel = newmap:WaitForChild("Spawns")
local spawns = spawnsmodel:GetChildren()
for i, player in ipairs(contestants) do
	if player and player.Character and #spawns > 0 then
		local torso = player.Character:WaitForChild("Torso")
		local humanoid = player.Character:WaitForChild("Humanoid")
		local spawnindex = math.random(1, #spawns)
		local spawn = spawns[spawnindex]
		if spawn and torso and humanoid then
			humanoid.Health = 100
			humanoid.WalkSpeed = 16
			table.remove(spawns, spawnindex)
			torso.CFrame = CFrame.new(spawn.Position + Vector3.new(0, 3, 0))
			
			local matchtag = Instance.new("StringValue")
			matchtag.Name = "MatchTag"
			matchtag.Parent = player.Character

			local backpack = player:FindFirstChild("Backpack")
			if backpack then
				if player == bloxxer then
					local sword = serverstorage:WaitForChild("Sword"):clone()
					sword.Parent = backpack
					event:FireClient(player, "Class", "Bloxxer")

					local mydata = playerdata[player.userId]
					if mydata and mydata.emeraldsword == 1 then
						local emeraldswordvalue = sword:FindFirstChild("EmeraldSword")
						if emeraldswordvalue then
							emeraldswordvalue.Value = true
						end
					end

				elseif player == sheriff then
					local netgun = serverstorage:WaitForChild("Net Gun"):clone()
					netgun.Parent = backpack
					event:FireClient(player, "Class", "Sheriff")
				else
					event:FireClient(player, "Class", "Bystander")
				end
			end
		end
	end
end
spawnsmodel:remove()

4 comments

0

Please don't steal scripts. I'm not helping

0

Steal? he openly gave this out

0

I have been following his tutorials the last month or so,I don't steal anything

0

Included code should be your own code. Ask the original writer of this script for help.

1 answer

✓ Accepted answer

Hello MrIncredible82

Your problem is that you either have to change your character type to R6 or you have to change every line that is trying to find the bodypart "Torso" to try to find the bodypart "HumanoidRootPart".

Your script does not work because Roblox changed these things when R15 came out and split the Torso into two parts: "LowerTorso" and "UpperTorso". You can see every bodypart in the r15 avatar here.

3 comments

0

I cannot thank you enough! I really appreciate your help.

0

Thank you so much

0

No problem man :)

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