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

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

Asked by 3 years ago

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

Log in to vote
3
Answered by
appxritixn 2235 Moderation Voter Community Moderator
3 years ago

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.

0
local c = plr.Character ? youngmacka123 17 — 3y
0
c is the player's character so i dont get it, everything else using the c variable works youngmacka123 17 — 3y
0
somehow i fixed by using plr.Character instead of c on this specific part of the script youngmacka123 17 — 3y
Ad

Answer this question