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

What does attempt to index number with 'TheVehicle' mean?

I cannot understand what this is trying to tell me. It's not very unclear and I have already searched for help but no posts helped me. Basically I have an object value called TheVehicle in every player's character but I get an error trying to do this:

local base = c["TheVehicle"].Value

Help is appreciated!

1 answer

Attempt to index number with [value] means you are trying to index, or get a 'sub-value' from a number value. As a number does not have anything to index, it throws an error.

In your case, the variable c is a number value, and your are attempting to index it with a string. In other words, you are treating a number as a table.

3 comments

0

local c = plr.Character ?

0

c is the player's character so i dont get it, everything else using the c variable works

0

somehow i fixed by using plr.Character instead of c on this specific part of the script

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