✓ Accepted answer
What the best thing to do would be to store all your information in a Library (which is a type of table) inside of a Module Script on the Server Side. The Server is the best place to store this type of information because it's more secure from exploiters rather than keeping it completely visible and view-able on the client.
A Module Script takes the whatever side you put it on, Server or Client. ReplicatedFirst would be Client while ServerScriptService would be Server.
To access it from the client, you would want to use a RemoteFunction to Invoke the server and return the data you need.
Example...
Library
local data = { sword = {damage = 5, cooldown = 1},
bow = {damage = 10, cooldown = 1.5}
}
local module = {}
module.getData(object)
return data[object]
end
return module
LibraryConnector Script
local LibraryConnector = game.ReplicatedStorage.LibraryConnector
local Library = require(game.ServerScriptService.Library)
local function onDataRequested(player, object)
return Library.getData(object)
end
LibraryConnector.OnServerInvoke = onDataRequested
Client Local Script
local LibraryConnector = game.ReplicatedStorage.LibraryConnector
local swordData = LibraryConnector:InvokeServer("sword")
Helpful link for understanding...
Remote Functions/Events
1 comment
Alright, thank you very much for your in depth answer, couldn't have wished for anything better!