Is it possible for a player to change the data within in a module Script from the client and affect the server? Lets say module is
ItemPrices = {100, 200, 300} return ItemPrices
For example lets say the price of an item is stored in a module script. If an exploiter would change the price of that item in the module script on the client side lets say running a script with the following code:
require(game.ReplicatedStorage.ItemPrices)[1] = 0
Would that change the value of the module script on the server side? Or only for the players client? For example right after the exploiter runs that script lets say I were to print on the server the price of Item 1. Would it print 100 or 0?
When a module script is required, it runs in the environment it is being required in. So modules required by local scripts can use Players.LocalPlayer
, handle user input, etc. If a server script required that module it couldn't do that. In short, modules required by server scripts run in server environment and modules required by local ones are ran in client environment. The same rules are followed.
So if you require from a local script, a server script should require it and get the proper values.