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

[Solved] Attempt to index local 'val' (a nil value). How to fix?

Okay, so I am making a very simple script that checks an IntValue, but I don't know how to do it, my code is already inefficient, but I just wanna know how to check an IntValue's value, this is what I tried to make sure my code was gonna work

local val = script.Parent.Parent.Parent.Parent:FindFirstChild"AccessLevel"
print(val.Value)

This is how I assumed I would call a value, but it doesn't work, instead I get this error: 16:24:39.867 - Workspace.AccessCard.Handle.SurfaceGui.Frame.Card Level.check:2: attempt to index local 'val' (a nil value), thank you in advance for helping!

1 answer

I figured it out. I had too little .Parent's.

1 comment

0

Edit your title and add [Solved] in front of the title name so that it is marked as being answered.

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