Making a program that creates a folder in a ModuleScript, and then stores this folder’s location for reference in an ObjectValue.
local f = mainFrame.createClone(buttons,forSale)
print("f is a "..typeof(f))
---- above are local variables
cloney.Value = f
It will print that ‘f’ is an instance, but when I try to store it in “cloney,” the ObjectValue, this happens:
https://gyazo.com/a728f94bad2031c047febaaf7fea2076
Here’s the ModuleScript:
tycoon = {}
---insert other functions that work fine here
function tycoon.createClone(buttons,items)
local folder = Instance.new("Folder",game.ServerStorage.playerBases)
local newName = false
while newName == false do
local name = random_string(6)
if valid(game.ServerStorage.playerBases,name) ~= true then
newName = true
folder.Name = name
end
end
return folder
end
return tycoon