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

Is it possible to convert an object value into that object?

So i'm trying to change some object's properties but i only have it's object value stored in an ObjectValue instance. Could i somehow refer to it with it's object value?

1 answer

✓ Accepted answer

You can use objectValue.Value to get the object. For example if I wanted the name of an object from just an object value, I could use

objectValue.Value.Name
--or
local obj = objectValue.Value
obj.Name

2 comments

0

Yeah but lets say i wanted to delete that object. How could i refer to it to say object:Destroy()

0

local obj = objectValue.Value and obj:Destroy()

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