Ok so, I have 3 scripts I need to know how I could send the parameter to the module script from a local script.

Local Script This has to remain a local script because I have a lostfocus() event in it. I would like to be able to use something like this

local SavedValues = require(game.ReplicatedStorage.Get)(Player)

I want to receive a table from the name of the player. This Player is NOT the local player.

Module Script 1 (Get Table) I need to have something like this but this will not work because I don't know how to send it the parameter "Player"

local SavedValues
function GetStore(Player)
local DataStore = game:GetService("DataStoreService"):GetDataStore("ApplicationTest")
local Key = "Player-"..Player.userId
SavedValues = DataStore:GetAsync(Key)
if not SavedValues then
SavedValues = "None"
end
end
GetStore()
return SavedValues

Module Script 2 I don't need this to return anything I just need it to save.

local function SaveStore(Key,SavedValues)
local DataStore = game:GetService("DataStoreService"):GetDataStore("ApplicationTest")
DataStore:SetAsync(Key, SavedValues)
end

7 comments

0

This appears to be a request.

0

I need to know how I could send the parameter to the module script from a local script.

0

if you call something in a module from a localscript you can use local things like game.Players.LocalPlayer in the module script

0

It says cant call datastore from client

1

The error tells the truth, you can't use datastore with a LocalScript, you'd have to use RemoteEvents or RemoteFunctions instead

0

Ok

0

i dont think you can send anything to a module script from a local script...