Hello, does anyone know how I can convert a object value to a string value or can anyone tell me what’s wrong here, it keeps returning nil for some reason
local realResult = tostring(result.Value)
script.Parent.realResult.Value = realResult
Hello, does anyone know how I can convert a object value to a string value or can anyone tell me what’s wrong here, it keeps returning nil for some reason
local realResult = tostring(result.Value)
script.Parent.realResult.Value = realResult
It depends what you want from the object. Objects can’t natively be converted into strings (they’re different types), but you can store data from it (such as object.Name to store its name).
What I want to convert is a Object Value set from a case opening module script, can I convert this type of value to a string?

No, objects can’t natively convert to strings - they’re completely different data types. I’d suggest changing your StringValue to an ObjectValue if that’s possible as it would save a lot of headache.
The Value of an ObjectValue is a reference to an Instance. You can simply run “ObjectValue.Value.Name” to get the name of the object. Ultimately you can’t convert an object into a string, you need to fetch its relevant name property.
local realResult = result.Value.Name -- Returns the name of the object
Even if you wanted to return the string value, you’d be trying to change the ObjectValue to a string (from what I can see from your code). Just be weary of that.
The tostring call is redundant. The Name property is already a string.