Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Module Scripts Client To Server Side?

Asked by 4 years ago

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?

0
psst don't forget to accept if i helped programmerHere 371 — 4y
0
Yes since they are just numbers after all, they're not bound to the mouse programmerHere 371 — 4y

1 answer

Log in to vote
1
Answered by 4 years ago
Edited 4 years ago

No. It would not.

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.

0
Thanks a ton! It was driving me crazy I was going worried. If you dont mind me asking where did you find this information? JoshChubi 74 — 4y
1
Experience. Just binge-read the developer hub and keep experimenting with things programmerHere 371 — 4y
0
im not a professional but is it possible to pass in values like the player's mouse? 123nabilben123 499 — 4y
0
like Mouse.Hit.X etc? 123nabilben123 499 — 4y
Ad

Answer this question