Jump to content

Different script lua file between client and server


Recommended Posts

I know that when a mod is tagged by "all-clients" then when joining a server , the players will automatically get those mods.

But what if the server admin edit a lua file like changing an item's drop rate from 0.5 to 0.1 ( Assuming this value cannot be changed in the mod configure ), while the lua on client's disk is still the origin, what will happen?

Link to comment
Share on other sites

Short Answer: Nothing.

Long Answer: Changes made to game-files only reflect where they have relevance & authority.

If a server owner (not admin) changed an item's drop rate, it would affect the rest of the clients, because the server owner runs the server. Therefore, they determine how each entity functions.

Edited by penguin0616
  • Like 1
Link to comment
Share on other sites

Quote

Short Answer: Nothing.

Long Answer: Changes made to game-files only reflect where they have relevance & authority.

If a server owner (not admin) changed an item's drop rate, it would affect the rest of the clients, because the server owner runs the server. Therefore, they determine how each entity functions.

Thanks you so much for answering, if it doesn't bother you, I have another question: So the client downloads the mod only to read the entity's name, texture, etc., while its recipes, operation mode, implementation function, etc. are all related to the server file?

Drop rate is just a value to read, but what if the owner edit a function(), such as what this function() returns, the inst tag, the inst component, or even the whole function(), will the client still get the correct function() on server-side? If so, then the server will have to handle a lot of network throughput.

Edited by Duorhs.M
Link to comment
Share on other sites

@Duorhs.M If the client has the mod, it doesn't get downloaded. If they don't, it's temporarily downloaded unless they have auto-subscribe enabled.

They can edit the mod as long as they don't change the version identifier, and their changes are relevant where they are used.

The end result of your edited function is solely determined on how/where it is used. The changes you make are not replicated to clients.

  • Like 1
  • Haha 1
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
  • Create New...