akitheone

Untitled

Nov 27th, 2019
137
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.98 KB | None | 0 0
  1. - 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...
  2. https://gyazo.com/e832c1fc8b0de3d35ade7bec64c04716
  3. Gyazo
  4. Gyazo
  5.  
  6.  
  7. ,GuruuLast Monday at 9:36 PM
  8. Some heavy updates with the container system. Now supports adding items and dynamically reloading slots on change.
  9. https://gyazo.com/9b035f1df4b70d72bffe760ac3899b86
  10. As you can see from the image, its as easy as
  11. self.mainInventory.AddItem(self.mainInventory, Item.new(1, 1))
  12. self.mainInventory:RefreshItems(Client)
  13.  
  14. 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:
  15. Gyazo
  16. Gyazo
  17.  
  18. self.mainInventory.AddItem(self.mainInventory, Item.new(1, 1))
  19. self.mainInventory.AddItem(self.mainInventory, Item.new(1, 1), 7)
  20. u can even do stuff liek this to assign items to specific slots :)
  21. https://gyazo.com/f6c0a50ac28d508e9cf95b6ecab7141a
  22.  
  23. ,GuruuYesterday at 1:03 AM
  24. https://gyazo.com/80e5a69d9b1e4c00d51538db5d741bcf ground item detections
  25. Gyazo
  26. Gyazo
  27.  
  28. ,GuruuYesterday at 1:18 AM
  29. https://gyazo.com/919d8f37ce79cf93dd1cc8a754279299 server sided validation.
  30.  
  31. 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
  32. while the one that does hover was spawned specifically for server and registered as a server object :slight_smile: come at us hackers :p
  33.  
  34. ,GuruuYesterday at 2:06 AM
  35. - validated game ground item object highlighter system implemented
  36. https://gyazo.com/859a2a06371fada8c514299c55343630
  37.  
  38. ,GuruuYesterday at 9:52 PM
  39. - https://gyazo.com/3e7009733b3c00bf7eddb7abc35780d3
  40.  
  41. - GroundItems are now interactable and can be picked up using E hotkey when the grab icon is visible.
  42. 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
  43. - 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
  44. - ground Items also destroy instantly as server executes pickup code
  45. Gyazo
  46. Gyazo
  47. 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)
  48. function WorldData.PickupGroundItem(GroundItemGui, Client)
  49. local groundItem = WorldData.ActiveGroundItems[GroundItemGui].groundItem
  50. if(groundItem ~= nil) then
  51. print("picking up ground item now.")
  52. WorldData.RemoveWorldObject(GroundItemGui)
  53. WorldData.GroundItemBeingInteractedWithPlayer[GroundItemGui] = nil
  54. WorldData.ActivePlayers[Client].mainInventory.AddItem(WorldData.ActivePlayers[Client].mainInventory, groundItem.item)
  55. WorldData.ActivePlayers[Client].mainInventory:RefreshItems(Client)
  56.  
  57. end
  58. end
  59.  
  60. ,GuruuYesterday at 11:01 PM
  61. - first person mode allows gui mouse movement
  62. https://gyazo.com/fc1b2186d80added20ae9c34be528d93
  63.  
  64. ,GuruuYesterday at 11:30 PM
  65. - 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
  66. https://gyazo.com/c536e7624dd65186f5a121be991a8164
Add Comment
Please, Sign In to add comment