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

How would I make the torso a valid member of the model?

The ingame image of the issue: https://gyazo.com/d3cd9846066c7eba9c2da0b26dd73b5b

Here are the lines of code:

Line 315-323:

model:Destroy()
	--Game.StarterGui:SetCoreGuiEnabled("PlayerList", true)
	player.PlayerGui:WaitForChild("MyGroup").M0.Visible = true
	player.Character.Torso.Anchored = false
	camera.CameraType = "Custom"
	camera.CameraSubject = player.Character.Humanoid
	tutorial.Parent = player.PlayerGui
	script.Parent:Destroy()
end

Line 325:

script.Parent.Frame.Skip.MouseButton1Down:connect(function () script.Parent.Parent.Intro:Stop(); Skip() end)

5 comments

0

Code block pls i cant really read dat

0

Alright I added the codeblock

0

Are you sure "player" is correct?

0

All of this was working before the roblox update but something caused this script to stop working and I don't know the issue

0

Try :FindFirstChild("Torso") For example, player.Character;FindFirstChild("Torso").Anchored = false

1 answer

The problem is that the script cannot find Torso.

This could be for two primary reasons: Torso hasn't loaded yet, or the model doesn't have a Torso object (e.g. the model is an R15 character).

What should solve your problem in this case is to use either WaitForChild or FindFirstChild.


FindFirstChild just looks in an object for a child named what you give it.

local Torso = Player.Character:FindFirstChild("Torso")

if Torso then -->> If the torso was found
	-->> Code
end

The if statement is to prevent the code from erroring (and subsequently breaking your script) if Torso was not found.


WaitForChild stops the code until the object it is searching for is found.

local Torso = Player.Character:WaitForChild("Torso")
-->> Code

Hope I helped!

TDP

1 comment

0

Thank you for the help

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