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

String values to locations?

So let's say I have string value named "val". And in this value it's stored a location given by another script with :GetFullName(). Now my question is, how could another script read this value and ACCESSthat location. Example: Script 1:

val = game.Workspace.StringValue
	val.Value = script.Parent:GetFullName() -- We got the location of the scripts parent
Script 2: 

-- this scripts job is to access that location.
	val = game.Workspace.StringValue
-- now what? We can read the value but how am I gonna tell the script that the value is the location?

1 answer

✓ Accepted answer

Don't

There's even a note on the Wiki if I remember correctly, noting that if you find yourself parsing this value then you're doing something very wrong. What you want to do instead is use an ObjectValue, and just set the value to script.Parent, so that val.Value is exactly what you meant it to be.

1 comment

0

Thanks, I didn't even know about object values

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