Client access to values in a server module script?

So I tried to get server module values script by client script but it always return with nil value

I don’t know any solution so far

My Server Script

local modulescript = require(game:GetService("ReplicatedStorage"):WaitForChild("ModuleScript"))

local Table1 = {"a","b","c"}
modulescript[1] = Table1

My Local Script

local modulescript = require(game:GetService("ReplicatedStorage"):WaitForChild("ModuleScript"))

print(modulescript[1])

My Module Script

local module = {}

return module

You can’t transfer data from server to client via ModuleScript, instead you should use a RemoteEvent.
Server:

local plr =  -- You should get the player here.
local table = {}
game.ReplicatedStorage.RemoteEvent:FireClient(plr, table)

Local script

game.ReplicatedStorage.RemoteEvent.OnClientEvent:Connect(function(table)
-- Your code
end)

Yea I think that the best solution for me

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