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

How would I use an object value?{solved}

Asked by
Nootian 184
4 years ago
Edited 4 years ago

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?

0
the main point is the very bottom of the question: How would I do objectVal.Value.Name without returning nil? Nootian 184 — 4y
0
just write it correctly. workspace.part is lowercase TOO. RAFA1608 543 — 4y

1 answer

Log in to vote
1
Answered by
RAFA1608 543 Moderation Voter
4 years ago
Edited 4 years ago

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)

0
I think I just mightve mispelled it but in the actual code I have an uppercase one, although that is not the problem Nootian 184 — 4y
0
good answer, exactly what i was thinking proqrammed 285 — 4y
0
workspace.part is lowercase too, so it doesnt exist, therefore making it NIL RAFA1608 543 — 4y
0
no, thats correct, I just want to know how I would do objectVal.Value.Name Nootian 184 — 4y
0
dont make the thingName a variable, just put it like this: print(objectVal.Value.Name) RAFA1608 543 — 4y
Ad

Answer this question