Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
1

Hwo should I approach making and inventory system?

Asked by 9 years ago

http://tinypic.com/r/rgz2o7/9 is the image of my explorer.

So Am I starting off alright? I don't know how I'm going to approach and start this. My goal is to be able to script a working inventory system. I want to only be able to have two items in hand or default backpack and the rest will be in the GUI inventory. I was thinking maybe have folders for each type of item and each item inside. Each folder containing the image the data and the item itself? And maybe somehow I can work that out. I really dont know how to approach this. I am in fact experienced with scripting too. I'm also almost losing my scope or main idea in which is to make a working basic system without much detail like the data of weapon image etc. I want to be able to put gear in gui inventory and be able to take out or interact in a way. Should i start with being able to get an item by pressing a key and putting it in my default backpack? Please do give me tips I'm not asking for script I just want a boost on what I should focus on doing.

The only code I got workign so far was being able to click on image in inventory nand have output print it works

script.Parent.MouseButton1Click:connect(function()
    print ("itworks")
end)
0
I'm currently stuck on this too, actually. :), more or less involving SAVING what you actually have though. I'm dealing with datastoring the objects as strings and loading them in on the player joining. ALSO, use tables to save the strings. By the way, you should look into modulescripts (one mother script controlling the rest), it'll make your life a hell of a lot easier. konichiwah1337 233 — 9y
0
k robloxiveboy 25 — 9y
0
@konichiwah1337 were you able to make an inventory gui and does it work? robloxiveboy 25 — 9y
0
Maybe a large dictionary for each slot? Or maybe a file for each slot saying whats in it with a value for each item. Teeter11 281 — 9y

1 answer

Log in to vote
2
Answered by
Prioxis 673 Moderation Voter
9 years ago

With my old system I made buttons and put a string value in the button object and then made a script for when you pick up an item it checks each item

local player = game.Players.localPlayer
local gui = player.PlayerGui.Inventory.Frame

if gui.Item1:FindFirstChild("Item").Value == "" then
gui.Item1:FindFirstChild("Item").Value = "ItemNameHere"
elseif gui.Item2:FindFirstChild("Item").Value == "" then
gui.Item2:FindFirstChild("Item").Value = "ItemNameHere"

pretty much the basic script you could also put a numbervalue for stack size say you pick up 5 rocks it'll have a number value for stack size says five

gui.Item1:FindFirstChild("Item").Value = "Rock"
gui.Item1:FindFirstChild("StackSize").Value = 5

for dropping an item you could do

script.Parent.MouseButton1Down:connect(function(click)
local c = game.Lighting:FindFirstChild(gui.Item1.Item.Value):Clone()
c.Parent = game.Workspace
c.CFrame = CFrame.new(player.Character:FindFirstChild("Right leg").CFrame)
c:FindFirstChild("StackSize").Value = gui.Item1:FindFirstChild("StackSize").Value
gui.Item1:FindFirstChild("Item").Value = ""

end)

pretty much the main jist of how one works message me on roblox if you want more help add me too I'm always willing to help

alextheotaku (got a name change)

Heres a working uncopylocked inventory system I just made for you :)

http://www.roblox.com/games/329189941/Inventory-System-Uncopylocked

very easy to use and edit I hope you enjoy stacksize isn't 100% working yet but you should be able to edit it

0
Rathdogg1765 why did you put local script to popen and close inventory in screen gui instead of frame itself>? robloxiveboy 25 — 9y
0
lol it doesn't matter either way I do some things just to keep stuff organized and preference :) Prioxis 673 — 9y
0
@Rathdogg1765 NVM dont answer what i said aww too late im sorry im just stupid XD i thought they were in different parts of explorer XD. I said nothing earlier poof. robloxiveboy 25 — 9y
0
lol no its fine :P Prioxis 673 — 9y
Ad

Answer this question