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

'attempt to index local 'WichAnim' (a number value)'?

Asked by 6 years ago
local WichAnim = math.random(2)

if WichAnim.Value == 1 then
    local Slash = char.Humanoid:LoadAnimation(script.parent.Handle.SwordSlash)
    Slash:Play()
end

if WichAnim.Value == 2 then
    local Slash2 = char.Humanoid:LoadAnimation(script.parent.Handle.SwordSlash2)
    Slash2:Play()
end

this script is part of a sword LOCALscript,

the error = attempt to index local 'WichAnim' (a number value) -- line 14 wich is

if WichAnim.Value == 1 then

i don't get it is it because it is a localscript?

if there is anything missing comment i will edit the post

0
You don't need .Value since WichAnim is just a number. So you should check if WhichAnim == 1 then GoldenPhysics 474 — 6y
0
Thank you TigerClaws454 48 — 6y

Answer this question