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

storing a directory in a Value?

lets say I want to get something from serverstorage:

game.ServerStorage.Script

now lets say I wanted to change that but I didnt want to go into the script to change it. would I be able to take "game.ServerStorage.Script" and put it in a value. that way if I change that value to "game.Workspace.Script" the script will use that to find said script. (I asked this question in chat and someone wanted me to make this question so they can answer it.)

here is an example:

local value = script.DirectoryVal--in this script is a stringvalue with its value set to: "game.ServerStorage.Script"


--so instead of this:
local wantedscript = game.ServerStorage.Script

--it would be this:
local wantedscript = value


--but it seems a stringvalue does not acomplish the desired task

1 answer

✓ Accepted answer

I was quite confused with your question but I'm pretty sure this is what you're looking for

Edit:

-- Script that handles the value:

 local valu = Instance.new("ObjectValue")
	valu.Name = "valu"
	valu.Parent = script
	repeat wait() until valu.Value ~= nil
	if game.ReplicatedStorage:FindFirstChild(valu.Value.Name) then
	print("found " .. valu.Value.Name)
	end

-- Script that sets the value:

repeat wait() until script.Parent.handler:FindFirstChild("valu")
script.Parent.handler.valu.Value = workspace.Baseplate


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