Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

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

Asked by 7 years ago
Edited 7 years ago

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

0
please put your code in the proper lua thing made for this ~GimmeWaffleBruh GimmeWaffleBruh 18 — 7y
0
my apologies this is better micy852 0 — 7y
0
Are you using an R15 or an R6 character? Because the R15 doesn't have "Torso", they have "UpperTorso" and "LowerTorso". jamesarsenault 192 — 7y
0
that did it, thank you all so much, this is a wonderful place. micy852 0 — 7y
View all comments (2 more)
0
Stop viewing out dated Youtube tutorials. cabbler 1942 — 7y
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. xEmmalyx 285 — 7y

1 answer

Log in to vote
0
Answered by 7 years ago

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.

Ad

Answer this question