Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- - abstract system in progress for objects/items/players/ and item containers such as: wooden box, large box, main inventory items, lootable items, equipped items and any other possible place u can think of where u can put items onto a slot of some sort.... Lil pic of whats going on...
- https://gyazo.com/e832c1fc8b0de3d35ade7bec64c04716
- Gyazo
- Gyazo
- ,GuruuLast Monday at 9:36 PM
- Some heavy updates with the container system. Now supports adding items and dynamically reloading slots on change.
- https://gyazo.com/9b035f1df4b70d72bffe760ac3899b86
- As you can see from the image, its as easy as
- self.mainInventory.AddItem(self.mainInventory, Item.new(1, 1))
- self.mainInventory:RefreshItems(Client)
- to add items and update the inventory the reason i have refreshitems as its own method rather it being in AddItem is because what if you wanted to add multiple items before refreshing to give refresh a seamless update :slight_smile: optimized. Hopefully some will appreciate the thought behind the code :kissing: if not its cool haha :slight_smile:
- Gyazo
- Gyazo
- self.mainInventory.AddItem(self.mainInventory, Item.new(1, 1))
- self.mainInventory.AddItem(self.mainInventory, Item.new(1, 1), 7)
- u can even do stuff liek this to assign items to specific slots :)
- https://gyazo.com/f6c0a50ac28d508e9cf95b6ecab7141a
- ,GuruuYesterday at 1:03 AM
- https://gyazo.com/80e5a69d9b1e4c00d51538db5d741bcf ground item detections
- Gyazo
- Gyazo
- ,GuruuYesterday at 1:18 AM
- https://gyazo.com/919d8f37ce79cf93dd1cc8a754279299 server sided validation.
- the reason one rock shows hover and the other doesnt is simple. The one that doesnt show hover is an object that was spawned by the client on default workspace
- while the one that does hover was spawned specifically for server and registered as a server object :slight_smile: come at us hackers :p
- ,GuruuYesterday at 2:06 AM
- - validated game ground item object highlighter system implemented
- https://gyazo.com/859a2a06371fada8c514299c55343630
- ,GuruuYesterday at 9:52 PM
- - https://gyazo.com/3e7009733b3c00bf7eddb7abc35780d3
- - GroundItems are now interactable and can be picked up using E hotkey when the grab icon is visible.
- The system is dynamically created so it supports any item being added to the inventory without adding any more code. Gonna be getting some more item models soon ill spawn around just to show it working with multiple items
- - Supports single player interactions meaning if two people decided to pick up the same object at the same time, the server will only allow who ever got to execute that interaction first (its impossible for the code to execute at the same exact ms) exploit free
- - ground Items also destroy instantly as server executes pickup code
- Gyazo
- Gyazo
- This is server handles a pickup. grounditemGUI is not pre defined, infact its generated and linked to every Server registed item during its spawn request...(whether it be building the object/dropping from inventory/craftin/or server spawned)
- function WorldData.PickupGroundItem(GroundItemGui, Client)
- local groundItem = WorldData.ActiveGroundItems[GroundItemGui].groundItem
- if(groundItem ~= nil) then
- print("picking up ground item now.")
- WorldData.RemoveWorldObject(GroundItemGui)
- WorldData.GroundItemBeingInteractedWithPlayer[GroundItemGui] = nil
- WorldData.ActivePlayers[Client].mainInventory.AddItem(WorldData.ActivePlayers[Client].mainInventory, groundItem.item)
- WorldData.ActivePlayers[Client].mainInventory:RefreshItems(Client)
- end
- end
- ,GuruuYesterday at 11:01 PM
- - first person mode allows gui mouse movement
- https://gyazo.com/fc1b2186d80added20ae9c34be528d93
- ,GuruuYesterday at 11:30 PM
- - Click to drag slots started (on mouse release will be when drag detection will stop ofc)and after it stops the slot will either drop item/swap items/or move to different item containers, and even swap between two different item containers) like trade maybe
- https://gyazo.com/c536e7624dd65186f5a121be991a8164
Add Comment
Please, Sign In to add comment