How do I make a list that gets items in ServerStorage to post into a scrolling frame?

I am attempting to make a scrolling frame list that prints out an entire item list from Server Storage

For some reason, it won’t print the items in this folder in ServerStorage.

I’ve attempted to make it local, getting the ServerStorage Service and nothing works. I’ve looked through all the DevForum and I haven’t found anything to help me.

Thank you for any help you give. I just want to know how to get this to print as I know it’s possible.

The Script itself.

--Made By MillerrIAm
--------------Variables------------
local Music = game:GetService("ServerStorage").MusicFolder:GetChildren()
SFrame = script.Parent.ScrollingFrame
Value = 0
Number = 0
-------------Main Script------------
while script.Disabled == false do
	for i,v in pairs(Music) do
		if Value == 0 then
			frame = SFrame.MusicFrame:Clone()
			frame.Visible = true
			frame.Parent = SFrame
			frame.Position = frame.Position + UDim2.new(0,0,0,Number)
			frame.Label.Text = v.Name
			Value = 1
		elseif Value == 1 then
			frame = SFrame.MusicFrame:Clone()
			frame.Visible = true
			frame.Parent = SFrame
			frame.Position = frame.Position + UDim2.new(0.5,0,0,Number)
			frame.Label.Text = v.Name
			Value = 0
			Number = Number + 50
		end
	end
	script.Disabled = true
end
2 Likes

You can’t see the contents of ServerStorage in a localscript, so you’ll want to move those items in another location such as ReplicatedStorage.

1 Like

Okay, I solved this, I just needed to make the script a ServerScript. I completely forgot I had it as a LocalScript.

First off the code should be server sided (Or you just put the Folder in ReplicatedStorage as Dummiez suggested) since you cannot actually access ServerScriptService and ServerStorage via the client.

And just as a friendly tip make your life easier!

This will auto correct the positions for you. :slight_smile:

2 Likes

You’ve could moved the folder to lighting and with a local script make the same too

Don’t do this. Lighting is not meant to store things. If you need to store something for both the client and the server to have access to it, use ReplicatedStorage.

2 Likes

Oh well thanks.
I’m new lol! thanks anyway