Jump to content

How to update items on client?

Recommended Posts

For example, I want to give a winter hat to Wilson on client. But he does not need hat if there is one near him. If so then he should go and take it by himself.

On Server:

AddPrefabPostInit("wilson",function(inst)	if not find_any_prefab(inst,"winterhat",100) then		inst.components.inventory:GiveItem(_G.SpawnPrefab("winterhat"))	endend)

All fine on server. On clients there is invisible hat.
Even if I set all_clients_require_mod = true, clients does not see all items on the server. This data is unavailable for clients. So they can't decide correctly to give or not to give the hat to Wilson.

So update function is needed.

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

  • Create New...