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()
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.