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

How would I use an object value?{solved}

I mean the object, ObjectValue, and I cannot add to it, for instance I can initialize it but not use it:

objectVal = workspace.ObjectValue
objectVal.Value = workspace.part



but here, when I try to use it:



thingName = objectVal.Value.Name

print(thingName)

Output:

nil

How would I do objectVal.Value.Name without returning nil?

2 comments

0

the main point is the very bottom of the question: How would I do objectVal.Value.Name without returning nil?

0

just write it correctly. workspace.part is lowercase TOO.

1 answer

✓ Accepted answer

Properties are case-sensitive. edit: parts, models, and any instance are case sensitive too

workspace.ObjectValue.value = workspace.Part

would not work because value isnt a property, but may be a part.

workspace.ObjectValue.Value = workspace.Part

would work because Value is a property, while value isnt. (uppercase and lowercase matters.) Hope that helped! edit: workspace.part is lowercase too, so it doesnt exist, therefore making it nil (unless the part is actually lowercase)

5 comments

0

I think I just mightve mispelled it but in the actual code I have an uppercase one, although that is not the problem

0

good answer, exactly what i was thinking

0

workspace.part is lowercase too, so it doesnt exist, therefore making it NIL

0

no, thats correct, I just want to know how I would do objectVal.Value.Name

0

dont make the thingName a variable, just put it like this: print(objectVal.Value.Name)

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