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

2 comments

0

You don't need .Value since WichAnim is just a number. So you should check if WhichAnim == 1 then

0

Thank you