So I'm trying to make a basic map selector gui. At the moment I'm only trying to get all the maps' names in ServerStorage which are in a Folder to print. (Everything works in play-solo in-studio, but not online or in test server) I have a local script in a gui which fires a remote event in a server script located in the ServerScriptService.
This is what I have in the server script:
local replicatedStorage = game:GetService("ReplicatedStorage")
local networking = replicatedStorage:WaitForChild("networking")
local remoteFunctions = networking:WaitForChild("remoteFunctions")
local remoteEvents = networking:WaitForChild("remoteEvents")
local remote = remoteEvents:WaitForChild("remote")
local remote2 = remoteEvents:WaitForChild("makeTrainerGuiVisible")
local remote3 = remoteEvents:WaitForChild("getMaps")
local serverStorage = game:GetService("ServerStorage")
local mapFolder = serverStorage:WaitForChild("mapFolder")
remote3.OnServerEvent:connect(function(plr)
local player = plr
local mapList = {}
local mapTable = mapFolder:GetChildren()
for i = 1, #mapTable do
table.insert(mapList, mapTable[i])
end
print (mapList[1])
remote3:FireClient(player, mapList)
end)
The server script successfully prints the name of the maps, but the local script doesn't print anything. Why would that be, what can I do to fix this?
Here's what's in the local script:
remote3.OnClientEvent:connect(function(mapList)
for i, v in pairs(mapList) do
print(i..'-'..tostring(v))
end
end)

1 comment
Ah.. crap, of course... Many thanks!