Maris Posted November 24, 2018 Share Posted November 24, 2018 All I want is to send unique number to all clients, so it will be the same for all users. For example, on the server: textureNumber = ZombRand(10); How can I send this value to client, so all users will see the same texture? Link to comment Share on other sites More sharing options...
Dr_Cox1911 Posted November 24, 2018 Share Posted November 24, 2018 There are two ways to do this: Using LuaNet Using the (basic) sendServerCommand and sendClientCommand What you should use depends on the functionality you want. With LuaNet you can do more advanced stuff like sending packages to certain players. The initial setup is more complicated though. As an example you can look at my CoxisServerMessage mod. Pretty much all my mods use LuaNet. With number 2 you have a rather easy setup, but lose some functionality. To use it you have the commands "sendClientCommand" and "sendServerCommand". To catch the packages there are the events "OnServerCommand" and "OnClientCommand". "OnServerCommand" and "sendClientCommand" is used on the client, "OnClientCommand" and "sendServerCommand" on the server. Personally I would suggest the LuaNet approach, because if you need some of the advanced functionality down the line or for another mod you are set. Maris 1 Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now