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

what do i change to fix "Torso is not valid a member of Model"?

hello - this is from a tutorial i'm trying to work through. Currently, I get one instance of the fireball, then Roblox throws error, "Torso is not valid a member of Model". I have this LocalScript is placed in StarterPack:

Enabled = true


Mouse.KeyDown:connect (function(key)
	if Enabled == false then return end
	key = key:lower()
	if key =="q" then
	Enabled = false
	Fireball = Instance.new("Part")
	Fireball.Shape = ("Ball")
	Fireball.Material = "Neon"
	Fireball.Parent = Character
	Fireball.CFrame = Character.Torso.CFrame*CFrame.new(0,0,-5)
	print("q")
	end
	Enabled = true
	
end)

Thanks for looking at this, Micy852

6 comments

0

please put your code in the proper lua thing made for this ~GimmeWaffleBruh

0

my apologies this is better

0

Are you using an R15 or an R6 character? Because the R15 doesn't have "Torso", they have "UpperTorso" and "LowerTorso".

0

that did it, thank you all so much, this is a wonderful place.

0

Stop viewing out dated Youtube tutorials.

0

It doesn't matter if it is outdated, the reason it didn't work is because of R15 and R6 not the fact it's an old script.

1 answer

First of all, do not use KeyDown. It is deprecated. Use UserInputService instead.

But more importantly, it is likely you are using R15, which do not have a Torso. Use Character.UpperTorso or Character.LowerTorso instead.

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