hi devforum. I’m currently trying to script a system that automatically plays different playlists for every boombox in my game. I use objectvalues inside a folder in replicatedstorage to store the location of each boombox
I’m attempting to loop through every objectvalue and store it’s value inside of a table.
Fyi, this is a Localscript inside of StarterPlayerScripts
local rs = game:GetService("ReplicatedStorage")
local children = rs:WaitForChild("BoomboxLocations"):GetChildren()
local boomboxes = {}
for _, v in pairs(children) do
if v:IsA("ObjectValue") then
table.insert(boomboxes, v.Value)
end
end
The children
table does work as intended, no problem there. For some odd reason though, after printing the boomboxes table, nothing is inside it. After trying to print v.Value
inside of the loop, it gives me nil
. Essentially, the objectvalue is returning nil, even though in the Explorer it’s clearly set.
I’ve attempted to move the location of the objectvalues plus parent folder around, for example, to be parented to this localscript inside of starterplayerscripts, or to be inside of replicatedstorage (above), however, it still doesn’t change a single thing.
After scouring through the devforum, I haven’t been able to find a proper solution to specific use case, so help would be very appreciated!! Thx in advance