Simple Concatenation question

local folderName = playerName.."Ships"
local serverLocation = game.ServerStorage.folderName --ERROR: folderName is not a valid member of ServerStorage "ServerStorage"
clone.Parent = serverLocation

When I print folderName, it prints the same name as when I do print serverstorage:GetChildren()
How can I make this work? The folder is created in another script, hence I need to create the name to access it

Can you show your explorer? Please thanks

For sure
Screenshot 2023-07-06 at 18.10.58

The script is trying to look for a folder name called folderName. To refer for the variable instead, use brackets around the variable:

local folderName = playerName.."Ships"
local serverLocation = game.ServerStorage[folderName]
clone.Parent = serverLocation
4 Likes

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.