OnItemClick???

salva

Friendly self-taught developer
Administrator
Jan 31, 2016
577
622
63
Hi all! Does anyone know any way to take the item in which the inventory is clicked? Or you should make a hook for this type OnItemClick?? greetings
 
Server on client side?

I imagine on the side of the server ... to know which item the player clicks on and thus be able to play with the inventory of the players or create a new way to use loot faster
 
I imagine on the side of the server ... to know which item the player clicks on and thus be able to play with the inventory of the players or create a new way to use loot faster
Server side I think doesn't recieve any sort of click events just move events.
I may try to look for client event.
I also want to add hurt and such events on the client.
 
That would be great, doing it on the server side would be perfect ... I imagine
 
I am almost 100% sure that the item click is not going to the server, since it would flood the network connection.
And would there be any way to move items from a chest to inventory on the client's side?
 
And would there be any way to move items from a chest to inventory on the client's side?

C#:
var boxInvId = NetEntityID.Get(Get());
var inventory = NetEntityID.Get(PlayerClient.GetLocalPlayer().rootControllable.gameObject);
for (var i = 0; i <= 30; i++) {
    Inventory.ItemMovePredicted(inventory, boxInvId, i, i);
}

C#:
public static LootableObject Get() {
    var lootableObJs = UnityEngine.Object.FindObjectsOfType < LootableObject > ();
    return lootableObJs.FirstOrDefault(lootableObJ => lootableObJ.IsLocalLooting());
}

EZz :p:p
 
  • Like
Reactions: salva
C#:
var boxInvId = NetEntityID.Get(Get());
var inventory = NetEntityID.Get(PlayerClient.GetLocalPlayer().rootControllable.gameObject);
for (var i = 0; i <= 30; i++) {
    Inventory.ItemMovePredicted(inventory, boxInvId, i, i);
}

C#:
public static LootableObject Get() {
    var lootableObJs = UnityEngine.Object.FindObjectsOfType < LootableObject > ();
    return lootableObJs.FirstOrDefault(lootableObJ => lootableObJ.IsLocalLooting());
}

EZz :p:p
That seems like a client side method that loops through all of the lootableobjects and checks if you are looting any.


And would there be any way to move items from a chest to inventory on the client's side?
That would require to call something on the server. What are you trying to achive with the click event?
 
That seems like a client side method that loops through all of the lootableobjects and checks if you are looting any.



That would require to call something on the server. What are you trying to achive with the click event?
This code gets all things from 0 to 30 slot in the inventory and transfers them to the active box - this is a draft worker
 
Hello everyone, could you give me the source code, I want to do the same, move the items with a simple click, could you help me?