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

Hello, I have a infinate yeild issue on Humanoid:WaitForChild("UpperTorso")'. Help please?

So I do know about properties and yeilds, however I cant find a solution to this section of my script.

local Player = game:GetService("Players").LocalPlayer
local char = Player.Character or Player.CharacterAdded:Wait()
local Humanoid = char:WaitForChild("Humanoid")
local Torso = Humanoid:WaitForChild("UpperTorso")

3 comments

0

Is it R15 or R6? Also try renaming the char variable since char is used for a string method.

0

R15, also when I rename the char variable, a error pops up for that.

0

Which is another infinate yeild as a warning

1 answer

✓ Accepted answer

There is no UpperTorso in the humanoid. You should try this:

local Player = game:GetService("Players").LocalPlayer
local char = Player.Character or Player.CharacterAdded:Wait()
local Humanoid = char:WaitForChild("Humanoid")
local Torso = char:WaitForChild("UpperTorso")

We make mistakes!

4 comments

0

How did I mess that up, silly me.

0

How did I mess that up, silly me.

0

How did I mess that up, silly me.

0

Haha! It's okay!

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