If ur lazy like me then copy this: Leaderstats code : game.Players.PlayerAdded:Connect(function(player) local inventory = Instance.new("Folder", player) inventory.Name = "Inventory" end) InventoryScript code: local InventoryEvent = game.ReplicatedStorage.Remotes.InventoryEvent game.Players.PlayerAdded:Connect(function(player) local inventory = player:WaitForChild("Inventory") local inventoryFrame = player.PlayerGui:WaitForChild("MenuGui").InventoryFrame.ItemsFrame:GetChildren()
inventory.ChildAdded:Connect(function(Item) InventoryEvent:FireClient(player, Item , true) end) end) InventoryEvent.OnServerEvent:Connect(function(player, ItemName, Value, button) if Value == false then local SelectedItem = player.Inventory:FindFirstChild(ItemName) local backpack = player.Backpack:GetChildren() local stuff = player.Character:GetChildren()
if #backpack == 0 and not player.Character:FindFirstChildWhichIsA("Tool") then button.Text = "Unequip" button.BackgroundColor3 = Color3.new(255,0,0) SelectedItem:Clone().Parent = player.Backpack else for i,v in ipairs(backpack) do button.Text = "Equip" button.BackgroundColor3 = Color3(0,255,0) v:Destroy() end end end
end) inventory local script: local InventoryEvent = game.ReplicatedStorage.Remotes.InventoryEvent local itemFrame = script.Parent:FindFirstChild("ItemsFrame") InventoryEvent.OnClientEvent:Connect(function(ItemName, Value) if Value == true then local ItemButton = script.Parent.ItemsFrame.ItemButton:Clone() ItemButton.Visible = true ItemButton.Name = ItemName.Name ItemButton.Text = ItemName.Name ItemButton.Parent = itemFrame local equipButton = script.Parent.EquipItemsFrame["Equip Button"]
ItemButton.MouseButton1Click:Connect(function() script.Parent.EquipFrame.Title.Text = ItemName.Name script.Parent.EquipFrame.Title.Visible = true equipButton.Visible = true end) end end) will add other code later
the inventory script at 4:10 is: local inventoryEvent = game.ReplicatedStorage.remotes.InventoryEvent game.Players.PlayerAdded:Connect(function(player)
local inventory = player:WaitForChild("Inventory")
local inventoryFrame = player.PlayerGui:WaitForChild("MenueGui").InventoryFrame.ItemsFrame:GetChildren()
if Value == false then local SelectedItem = player.Inventory:FindFirstChildind(ItemName) local backpack = player.Backpack:getChildren() local stuff = player.Character:GetChildren()
if #backpack == 0 and not player.character:FindFirstChildWhichIsA("Tool") then Button.Text = "unequip" button.BackgroundColor3 = Color3.new(255,0,0) SelectedItem:Clone().Parent = player.Backpack else for i,v in ipairs(backpack) do Button.Text = "equip" button.BackgroundColor3 = Color3.new(0, 255, 0) v:Destroy() end for i, v in ipairs(stuff) do if v:IsA("tool") then button.Text = "Equip" Button.BackgroundColor3 = Color3.new(0, 225, 0) v:Destroy() end end end end end)
@@unnaturaldodo the one without any typos local inventoryEvent = game.ReplicatedStorage.Remotes.InventoryEvent game.Players.PlayerAdded:Connect(function(player) local inventory = player:WaitForChild("Inventory") local inventoryFrame = player.PlayerGui.MenuGui.InventoryFrame.ItemsFrame:GetChildren() inventory.ChildAdded:Connect(function(Item) inventoryEvent:FireClient(player, Item, true) end) end) inventoryEvent.OnServerEvent:Connect(function(player, ItemName, Value, button)
if value == false then local SelectedItem = player.Inventory:FindFirstChild(ItemName) local backpack = player.BackPack:GetChildren() local stuff = player.Character:GetChildren()
if #backpack == 0 and not player.Character:FindFirstChildWhichIsA("Tool") then button.Text = "Unequip" button.BackgroundColor3 = Color3.new(255, 0, 0) SelectedItem:Clone().Parent = player.BackPack else for i,v in ipairs(backpack) do button.text = "Equip" button.BackgroundColor3 = Color3.new(0,255,0) v:Destroy() end for i, v in ipairs(stuff)do if v:IsA("Tool") then button.Text = "Equip" button.BackgroundColor3 = Color3.new(0, 255, 0) v:Destroy() end end end end end)
If you want to add a image to it then put if ItemButton.Text == "ClassicSword" then ItemButton.Image = "--Your Image" End under ItemButton.Parent = ItemFrame in InventoryLocalScript make sure to add a image label to the button
bro i try to equip a backpack and i did everything it doesnt want to get in my inventory. And the item dosnt have a handle. is that why? bro its not very clear sometimes😅
local prompt = script.Parent.ProximityPrompt local Dreidle = script.Parent.Parent prompt.Triggered:Connect(function)(Player) prompt:Destroy() Dreidle.Parent = Player.Inventory end
btw in this video he does not show how to make it so the tools save if the player leaves the game, i found out a way so that it works. I also added a delete button and made it a scrolling frame
@@73117I have the items saved and load in kind of a difficult way to explain but I’ll try. When a player joins I have my DataStoreService script check if a player has a folder named ‘Items’ and if they don’t the script will add the folder from replicatedStorage. In the folder I have BoolValues that are named after each obtainable item in the game and are set to false but if a play collects an item/tool their value is changed to true and the player receives the item in their inventory. When a player leaves the game the DataStoreService script saves each value (true or false). Again when the player loads back in since the folder and values are now saved, which ever values are true the script will give the player those items/tools accordingly. If you are unsure how to do any of these things. Try finding a video on saving and loading players data and then find a video on BoolValues. Hope this helped
Heres the Inventory script 4:10 for those who are lazy: local InventoryEvent = game.ReplicatedStorage.Remotes.InventoryEvent game.Players.PlayerAdded:Connect(function(player)
local inventory = player:WaitForChild("Inventory")
local inventoryFrame = player.PlayerGui:WaitForChild("MenuGui").InventoryFrame.ItemsFrame:GetChildren()
if Value == false then local SelectedItem = player.Inventory:FindFirstChild(ItemName) local backpack = player.Backpack:GetChildren() local stuff = player.Character:GetChildren()
if #backpack == 0 and not player.Character:FindFirstChildWhichIsA("Tool") then button.Text = "Unequip" button.BackgroundColor3 = Color3.new(255,0,0) SelectedItem:Clone().Parent = player.Backpack else for i,v in ipairs(backpack) do button.Text = "Equip" button.BackgroundColor3 = Color3.new(0, 255, 0) v:Destroy() end for i, v in ipairs(stuff) do if v:IsA("Tool") then button.Text = "Equip" button.BackgroundColor3 = Color3.new(0, 255, 0) v:Destroy() end end end end end)
Leaderstats code : game.Players.PlayerAdded:Connect(function(player) local inventory = Instance.new("Folder", player) inventory.Name = "Inventory" end) InventoryScript code: local InventoryEvent = game.ReplicatedStorage.Remotes.InventoryEvent game.Players.PlayerAdded:Connect(function(player) local inventory = player:WaitForChild("Inventory") local inventoryFrame = player.PlayerGui:WaitForChild("MenuGui").InventoryFrame.ItemsFrame:GetChildren()
inventory.ChildAdded:Connect(function(Item) InventoryEvent:FireClient(player, Item , true) end) end) InventoryEvent.OnServerEvent:Connect(function(player, ItemName, Value, button) if Value == false then local SelectedItem = player.Inventory:FindFirstChild(ItemName) local backpack = player.Backpack:GetChildren() local stuff = player.Character:GetChildren()
if #backpack == 0 and not player.Character:FindFirstChildWhichIsA("Tool") then button.Text = "Unequip" button.BackgroundColor3 = Color3.new(255,0,0) SelectedItem:Clone().Parent = player.Backpack else for i,v in ipairs(backpack) do button.Text = "Equip" button.BackgroundColor3 = Color3(0,255,0) v:Destroy() end end end
end) inventory local script: local InventoryEvent = game.ReplicatedStorage.Remotes.InventoryEvent local itemFrame = script.Parent:FindFirstChild("ItemsFrame") InventoryEvent.OnClientEvent:Connect(function(ItemName, Value) if Value == true then local ItemButton = script.Parent.ItemsFrame.ItemButton:Clone() ItemButton.Visible = true ItemButton.Name = ItemName.Name ItemButton.Text = ItemName.Name ItemButton.Parent = itemFrame local equipButton = script.Parent.EquipItemsFrame["Equip Button"]
ItemButton.MouseButton1Click:Connect(function() script.Parent.EquipFrame.Title.Text = ItemName.Name script.Parent.EquipFrame.Title.Visible = true equipButton.Visible = true end) end end) this is not my sode but i copied it so i could watch the vid and copie this at the same time
reply to desription "Note: At 7:42 I accidently inserted a script and not a local script. Make sure to make it a local script, or otherwise the GUI will open for every single player." That isn't true, it will only open for the player that pressed it anyways
I am pretty sure it is true, because server scripts work for the server and local scripts work for the client. You should test it out with the play with multiple clients feature to see if I am wrong but even if I am, it's always safer to open guis with a client script.
@@Mirixas since theres a copy of the GUI in every player(including the server script), script.Parent.Parent.Frame.Visible = true just makes that one players frame visible on the server side, not for all players
I have a question can you make a video where if you kill a boss it will give you an drop like dungeon quest because i cant find a single video of drops like dungeon quest for inv
game.Players.PlayerAdded:Connect(function(player) local inventory = Instance.new("Folder", player) inventory.Name = "Inventory" end) InventoryScript code: local InventoryEvent = game.ReplicatedStorage.Remotes.InventoryEvent game.Players.PlayerAdded:Connect(function(player) local inventory = player:WaitForChild("Inventory") local inventoryFrame = player.PlayerGui:WaitForChild("MenuGui").InventoryFrame.ItemsFrame:GetChildren()
inventory.ChildAdded:Connect(function(Item) InventoryEvent:FireClient(player, Item , true) end) end) InventoryEvent.OnServerEvent:Connect(function(player, ItemName, Value, button) if Value == false then local SelectedItem = player.Inventory:FindFirstChild(ItemName) local backpack = player.Backpack:GetChildren() local stuff = player.Character:GetChildren()
if #backpack == 0 and not player.Character:FindFirstChildWhichIsA("Tool") then button.Text = "Unequip" button.BackgroundColor3 = Color3.new(255,0,0) SelectedItem:Clone().Parent = player.Backpack else for i,v in ipairs(backpack) do button.Text = "Equip" button.BackgroundColor3 = Color3(0,255,0) v:Destroy() end end end
end) inventory local script: local InventoryEvent = game.ReplicatedStorage.Remotes.InventoryEvent local itemFrame = script.Parent:FindFirstChild("ItemsFrame") InventoryEvent.OnClientEvent:Connect(function(ItemName, Value) if Value == true then local ItemButton = script.Parent.ItemsFrame.ItemButton:Clone() ItemButton.Visible = true ItemButton.Name = ItemName.Name ItemButton.Text = ItemName.Name ItemButton.Parent = itemFrame local equipButton = script.Parent.EquipItemsFrame["Equip Button"]
ItemButton.MouseButton1Click:Connect(function() script.Parent.EquipFrame.Title.Text = ItemName.Name script.Parent.EquipFrame.Title.Visible = true equipButton.Visible = true end) end end) will add other code later 35 Reply 7 replies @404-mz2ly 4 months ago Thank you! I finally made a inventory! I was struggled, but I fix it! Ty 1 Reply @BlueGuy_102 11 months ago underrated 3 Reply @ameliezhang-ku2zr 2 months ago i struggled throughout the video but i made it!! Im planning on publishing a game in roblox! tysm!!!!! Reply @001i7 11 months ago This is very useful, but can you create a tool tool? would fit perfectly with your inventory system 5 Reply @Mosio_RBLX 6 months ago game.Players.PlayerAdded:connect(function(player) local inventory = Instance.new(''Folder'',player) inventory.Name = ''Inventory end) Heres the leaderstats script 6 Reply Mirixas · 8 replies @kisub2307 3 months ago Leaderstats code : game.Players.PlayerAdded:Connect(function(player) local inventory = Instance.new("Folder", player) inventory.Name = "Inventory" end) InventoryScript code: local InventoryEvent = game.ReplicatedStorage.Remotes.InventoryEvent game.Players.PlayerAdded:Connect(function(player) local inventory = player:WaitForChild("Inventory") local inventoryFrame = player.PlayerGui:WaitForChild("MenuGui").InventoryFrame.ItemsFrame:GetChildren()
inventory.ChildAdded:Connect(function(Item) InventoryEvent:FireClient(player, Item , true) end) end) InventoryEvent.OnServerEvent:Connect(function(player, ItemName, Value, button) if Value == false then local SelectedItem = player.Inventory:FindFirstChild(ItemName) local backpack = player.Backpack:GetChildren() local stuff = player.Character:GetChildren()
if #backpack == 0 and not player.Character:FindFirstChildWhichIsA("Tool") then button.Text = "Unequip" button.BackgroundColor3 = Color3.new(255,0,0) SelectedItem:Clone().Parent = player.Backpack else for i,v in ipairs(backpack) do button.Text = "Equip" button.BackgroundColor3 = Color3(0,255,0) v:Destroy() end end end
end) inventory local script: local InventoryEvent = game.ReplicatedStorage.Remotes.InventoryEvent local itemFrame = script.Parent:FindFirstChild("ItemsFrame") InventoryEvent.OnClientEvent:Connect(function(ItemName, Value) if Value == true then local ItemButton = script.Parent.ItemsFrame.ItemButton:Clone() ItemButton.Visible = true ItemButton.Name = ItemName.Name ItemButton.Text = ItemName.Name ItemButton.Parent = itemFrame local equipButton = script.Parent.EquipItemsFrame["Equip Button"]
ItemButton.MouseButton1Click:Connect(function() script.Parent.EquipFrame.Title.Text = ItemName.Name script.Parent.EquipFrame.Title.Visible = true equipButton.Visible = true end) end end) this is not my sode but i copied it so i could watch the vid and copie this at the same time 3 Reply @DogeGamingYt2014 11 months ago Nice😊 3 Reply @MAINZ-nz5uu 11 months ago Really useful, even for pros😂 3 Reply @Lala_produdeplayz-wy6gb 2 months ago noice
Will this broken when this uses to tools that changes itself names further? I mean the in my game the tools when it’s on cooldown it will change the name as “Cooldown!”, can it breaks when the tool name was cooldown and player Unequip and equip again causes script stack end or duplicated tools?
Hello! Nice tutorial, but at 5:49, it is a bit hard to see the end script, so you could make it easier to see on the next videos. Overall good video, keep it up!
@@smoggypanda4000 -- LocalScript inside the i forgot but just play around on where to put it like inventory frame or smth then name it PressInventory local UserInputService = game:GetService("UserInputService") local inventoryFrame = script.Parent:WaitForChild("InventoryFrame") -- Initially hide the inventory inventoryFrame.Visible = false -- Function to toggle inventory visibility local function toggleInventory() inventoryFrame.Visible = not inventoryFrame.Visible end -- Detect key press UserInputService.InputBegan:Connect(function(input, gameProcessed) if not gameProcessed then -- Check that the key press is not being used by other UI elements if input.KeyCode == Enum.KeyCode.E then toggleInventory() end end end)
@@smoggypanda4000 here --insert a LocalScript inside the StarterGui name it PressInventory local UserInputService = game:GetService("UserInputService") local inventoryFrame = script.Parent:WaitForChild("InventoryFrame") -- Initially hide the inventory inventoryFrame.Visible = false -- Function to toggle inventory visibility local function toggleInventory() inventoryFrame.Visible = not inventoryFrame.Visible end -- Detect key press UserInputService.InputBegan:Connect(function(input, gameProcessed) if not gameProcessed then -- Check that the key press is not being used by other UI elements if input.KeyCode == Enum.KeyCode.E then toggleInventory() end end end) Comes with explanation so that you wont have to rely on copy and past
Is it really that hard just to put the scripts in the description. People dont understand you cant zoom in on the computer so its hard to see, and its insane to be going back and forth to video then back to the script trying to follow along. L video
Is it that hard to just rewrite the script by yourself? What about you just try to write the script, before complaining that "its hard to see" when you haven't even watched the video and just want to CTRL C + CTRL V the script. If you don't like it then you can go ahead and learn how to make the inventory system yourself. And if you have problems going back and forth then just remember, that the PAUSE button exists.
@@Mirixas well i found Its dozens of videos of people doing it while adding the script in description , so who cares. its people probably clicked on this video and seen you had no scripts in description and left. I literally found a video of some doing this in 5 min video. boom bam done. sooooooo i like and subscribed to them instead of a lil punk like you
local title = script.Parent.Parent.title local InventoryEvent = game.ReplicatedStorage.remotes.invntroyEvent script.Parent.MouseButton1Click:Connect(function() InventoryEvent:FireServer(title.Text, false, script.Parent) end)
if Value == false then local SelectedItem = player.Inventory:FindFirstChild(ItemName) local backpack = player.Backpack:GetChildren() local stuff = player.Character:GetChildren()
if #backpack == 0 and not player.Character:FindFirstChildWichIsA("Tool") then button.text = "Unequip" button.BackgroundColor3 = Color3.new(255,0,0) SelectedItem:Clone().Parent = player.Backpack else for i,v in ipairs(stuff) do if v:IsA("Tool") then button.text = "Equip" button.BackgroundColor3 - Color3.new(0,255,0) v:destroy() end end end end end) THANK ME LATER
If ur lazy like me then copy this:
Leaderstats code :
game.Players.PlayerAdded:Connect(function(player)
local inventory = Instance.new("Folder", player)
inventory.Name = "Inventory"
end)
InventoryScript code:
local InventoryEvent = game.ReplicatedStorage.Remotes.InventoryEvent
game.Players.PlayerAdded:Connect(function(player)
local inventory = player:WaitForChild("Inventory")
local inventoryFrame = player.PlayerGui:WaitForChild("MenuGui").InventoryFrame.ItemsFrame:GetChildren()
inventory.ChildAdded:Connect(function(Item)
InventoryEvent:FireClient(player, Item , true)
end)
end)
InventoryEvent.OnServerEvent:Connect(function(player, ItemName, Value, button)
if Value == false then
local SelectedItem = player.Inventory:FindFirstChild(ItemName)
local backpack = player.Backpack:GetChildren()
local stuff = player.Character:GetChildren()
if #backpack == 0 and not player.Character:FindFirstChildWhichIsA("Tool") then
button.Text = "Unequip"
button.BackgroundColor3 = Color3.new(255,0,0)
SelectedItem:Clone().Parent = player.Backpack
else
for i,v in ipairs(backpack) do
button.Text = "Equip"
button.BackgroundColor3 = Color3(0,255,0)
v:Destroy()
end
end
end
end)
inventory local script:
local InventoryEvent = game.ReplicatedStorage.Remotes.InventoryEvent
local itemFrame = script.Parent:FindFirstChild("ItemsFrame")
InventoryEvent.OnClientEvent:Connect(function(ItemName, Value)
if Value == true then
local ItemButton = script.Parent.ItemsFrame.ItemButton:Clone()
ItemButton.Visible = true
ItemButton.Name = ItemName.Name
ItemButton.Text = ItemName.Name
ItemButton.Parent = itemFrame
local equipButton = script.Parent.EquipItemsFrame["Equip Button"]
ItemButton.MouseButton1Click:Connect(function()
script.Parent.EquipFrame.Title.Text = ItemName.Name
script.Parent.EquipFrame.Title.Visible = true
equipButton.Visible = true
end)
end
end)
will add other code later
tysm!
we need more people like you
Yo!
tysmmmmmmmmm
he said he's lazy but he had to type all of this for us
the inventory script at 4:10 is:
local inventoryEvent = game.ReplicatedStorage.remotes.InventoryEvent
game.Players.PlayerAdded:Connect(function(player)
local inventory = player:WaitForChild("Inventory")
local inventoryFrame = player.PlayerGui:WaitForChild("MenueGui").InventoryFrame.ItemsFrame:GetChildren()
inventory.ChildAdded:Connect((function(item)
inventoryEvent:Fireclient(player, item, true)
end)
end)
inventoryEvent.OnServerEvent:connect(function(player, ItemName, Value, Button)
if Value == false then
local SelectedItem = player.Inventory:FindFirstChildind(ItemName)
local backpack = player.Backpack:getChildren()
local stuff = player.Character:GetChildren()
if #backpack == 0 and not player.character:FindFirstChildWhichIsA("Tool") then
Button.Text = "unequip"
button.BackgroundColor3 = Color3.new(255,0,0)
SelectedItem:Clone().Parent = player.Backpack
else
for i,v in ipairs(backpack) do
Button.Text = "equip"
button.BackgroundColor3 = Color3.new(0, 255, 0)
v:Destroy()
end
for i, v in ipairs(stuff) do
if v:IsA("tool") then
button.Text = "Equip"
Button.BackgroundColor3 = Color3.new(0, 225, 0)
v:Destroy()
end
end
end
end
end)
thank youu
geez why so much typo
wow, most usfull comment ever
We need more guy like u
@@unnaturaldodo
the one without any typos
local inventoryEvent = game.ReplicatedStorage.Remotes.InventoryEvent
game.Players.PlayerAdded:Connect(function(player)
local inventory = player:WaitForChild("Inventory")
local inventoryFrame = player.PlayerGui.MenuGui.InventoryFrame.ItemsFrame:GetChildren()
inventory.ChildAdded:Connect(function(Item)
inventoryEvent:FireClient(player, Item, true)
end)
end)
inventoryEvent.OnServerEvent:Connect(function(player, ItemName, Value, button)
if value == false then
local SelectedItem = player.Inventory:FindFirstChild(ItemName)
local backpack = player.BackPack:GetChildren()
local stuff = player.Character:GetChildren()
if #backpack == 0 and not player.Character:FindFirstChildWhichIsA("Tool") then
button.Text = "Unequip"
button.BackgroundColor3 = Color3.new(255, 0, 0)
SelectedItem:Clone().Parent = player.BackPack
else
for i,v in ipairs(backpack) do
button.text = "Equip"
button.BackgroundColor3 = Color3.new(0,255,0)
v:Destroy()
end
for i, v in ipairs(stuff)do
if v:IsA("Tool") then
button.Text = "Equip"
button.BackgroundColor3 = Color3.new(0, 255, 0)
v:Destroy()
end
end
end
end
end)
If you want to add a image to it then put
if ItemButton.Text == "ClassicSword" then
ItemButton.Image = "--Your Image"
End
under ItemButton.Parent = ItemFrame in InventoryLocalScript
make sure to add a image label to the button
You're the goat
This is very useful, but can you create a tool tool? would fit perfectly with your inventory system
Hey guys! If you need help with these scripts, join my Discord and ask for help there.
Dude which editing software do u use?
Part 2 pls
bro i try to equip a backpack and i did everything it doesnt want to get in my inventory. And the item dosnt have a handle. is that why? bro its not very clear sometimes😅
And also, When I tested it out, it just started showing up when I just tested it instead of showing up when it clicked the button
local prompt = script.Parent.ProximityPrompt
local Dreidle = script.Parent.Parent
prompt.Triggered:Connect(function)(Player)
prompt:Destroy()
Dreidle.Parent = Player.Inventory
end
btw in this video he does not show how to make it so the tools save if the player leaves the game, i found out a way so that it works. I also added a delete button and made it a scrolling frame
how
@@73117 500 robux
@@73117 300 robux
@@73117 300 robux
@@73117I have the items saved and load in kind of a difficult way to explain but I’ll try. When a player joins I have my DataStoreService script check if a player has a folder named ‘Items’ and if they don’t the script will add the folder from replicatedStorage. In the folder I have BoolValues that are named after each obtainable item in the game and are set to false but if a play collects an item/tool their value is changed to true and the player receives the item in their inventory. When a player leaves the game the DataStoreService script saves each value (true or false). Again when the player loads back in since the folder and values are now saved, which ever values are true the script will give the player those items/tools accordingly. If you are unsure how to do any of these things. Try finding a video on saving and loading players data and then find a video on BoolValues. Hope this helped
Heres the Inventory script 4:10 for those who are lazy:
local InventoryEvent = game.ReplicatedStorage.Remotes.InventoryEvent
game.Players.PlayerAdded:Connect(function(player)
local inventory = player:WaitForChild("Inventory")
local inventoryFrame = player.PlayerGui:WaitForChild("MenuGui").InventoryFrame.ItemsFrame:GetChildren()
inventory.ChildAdded:Connect(function(Item)
InventoryEvent:FireClient(player, Item, true)
end)
end)
InventoryEvent.OnServerEvent:Connect(function(player, ItemName, Value, button)
if Value == false then
local SelectedItem = player.Inventory:FindFirstChild(ItemName)
local backpack = player.Backpack:GetChildren()
local stuff = player.Character:GetChildren()
if #backpack == 0 and not player.Character:FindFirstChildWhichIsA("Tool") then
button.Text = "Unequip"
button.BackgroundColor3 = Color3.new(255,0,0)
SelectedItem:Clone().Parent = player.Backpack
else
for i,v in ipairs(backpack) do
button.Text = "Equip"
button.BackgroundColor3 = Color3.new(0, 255, 0)
v:Destroy()
end
for i, v in ipairs(stuff) do
if v:IsA("Tool") then
button.Text = "Equip"
button.BackgroundColor3 = Color3.new(0, 255, 0)
v:Destroy()
end
end
end
end
end)
7:10 when i tried to make it transparent it only made itself and not the others transparent.
game.Players.PlayerAdded:connect(function(player)
local inventory = Instance.new(''Folder'',player)
inventory.Name = ''Inventory
end)
Heres the leaderstats script
This isn't even correct
@@Mirixas lol
@@Mirixas it is indeed correct
XD
@@PopppDev Firstly, :Connect is spelt with an uppercase, not a lowercase. Secondly, he forgot to close "Inventory" with a ".
Thank you! I finally made a inventory! I was struggled, but I fix it! Ty
Leaderstats code :
game.Players.PlayerAdded:Connect(function(player)
local inventory = Instance.new("Folder", player)
inventory.Name = "Inventory"
end)
InventoryScript code:
local InventoryEvent = game.ReplicatedStorage.Remotes.InventoryEvent
game.Players.PlayerAdded:Connect(function(player)
local inventory = player:WaitForChild("Inventory")
local inventoryFrame = player.PlayerGui:WaitForChild("MenuGui").InventoryFrame.ItemsFrame:GetChildren()
inventory.ChildAdded:Connect(function(Item)
InventoryEvent:FireClient(player, Item , true)
end)
end)
InventoryEvent.OnServerEvent:Connect(function(player, ItemName, Value, button)
if Value == false then
local SelectedItem = player.Inventory:FindFirstChild(ItemName)
local backpack = player.Backpack:GetChildren()
local stuff = player.Character:GetChildren()
if #backpack == 0 and not player.Character:FindFirstChildWhichIsA("Tool") then
button.Text = "Unequip"
button.BackgroundColor3 = Color3.new(255,0,0)
SelectedItem:Clone().Parent = player.Backpack
else
for i,v in ipairs(backpack) do
button.Text = "Equip"
button.BackgroundColor3 = Color3(0,255,0)
v:Destroy()
end
end
end
end)
inventory local script:
local InventoryEvent = game.ReplicatedStorage.Remotes.InventoryEvent
local itemFrame = script.Parent:FindFirstChild("ItemsFrame")
InventoryEvent.OnClientEvent:Connect(function(ItemName, Value)
if Value == true then
local ItemButton = script.Parent.ItemsFrame.ItemButton:Clone()
ItemButton.Visible = true
ItemButton.Name = ItemName.Name
ItemButton.Text = ItemName.Name
ItemButton.Parent = itemFrame
local equipButton = script.Parent.EquipItemsFrame["Equip Button"]
ItemButton.MouseButton1Click:Connect(function()
script.Parent.EquipFrame.Title.Text = ItemName.Name
script.Parent.EquipFrame.Title.Visible = true
equipButton.Visible = true
end)
end
end)
this is not my sode but i copied it so i could watch the vid and copie this at the same time
It shows me an error saying that, Inventory is not a valid member of player, this is located in InventoryScript line 17, how do i fix this??? Pls help
It should probably be backpack not inventory hope I can help 😊
One recommendation add a image label on the equip screen that has the image id set to the texture id of the items little logo thing.
reply to desription "Note: At 7:42 I accidently inserted a script and not a local script. Make sure to make it a local script, or otherwise the GUI will open for every single player."
That isn't true, it will only open for the player that pressed it anyways
I am pretty sure it is true, because server scripts work for the server and local scripts work for the client. You should test it out with the play with multiple clients feature to see if I am wrong but even if I am, it's always safer to open guis with a client script.
@@Mirixas since theres a copy of the GUI in every player(including the server script), script.Parent.Parent.Frame.Visible = true just makes that one players frame visible on the server side, not for all players
Really useful, even for pros😂
It only lets me equip one item at a time, do you think you can help?
thats the point
@@elfyblox 💀
underrated
What does THIS mean?:
ServerScriptService.InventoryScript:25: attempt to index nil with 'Clone'
either means the item does not exist and when you try to clone the item it breaks
OR
you typed the item wrong
@@JustZack4 is right. But if your script still doesn't work, you can join my discord and ask for help in the #scripting-help channel.
Or you don't have updated studio so you can't use that
Im having this issue as well, anyone can help?
5:56 Script
local Inventory Event
game.ReplicatedStorage.Remotes. Inventory Event
local itemFrame = script.Parent: FindFirstChild("Items Frame")
InventoryEvent.OnClientEvent: Connect(function(ItemName, Value) if Value==true then
end)
end
local ItemButton = script.Parent.Items Frame.ItemButton: Clone() ItemButton.Visible = true
ItemButton.Name = ItemName.Name ItemButton.Text = ItemName.Name ItemButton.Parent = itemFrame
local equipButton = script. Parent.Equip Frame [ "Equip Button"]
ItemButton.MouseButton1Click: Connect(function()
end)
script.Parent.Equip Frame.Title.Text = ItemName.Name script. Parent.EquipFrame.Title.Visible = true
script. Parent.EquipFrame.Description.Visible = true script.Parent.Equip Frame.Description.Text =
(I USE AN APP FOR THIS SO CHECK)
Works perfectly, just struggling trying to make a trash script to destroy the buttons and the items 😢
i struggled throughout the video but i made it!! Im planning on publishing a game in roblox! tysm!!!!!
I have a question can you make a video where if you kill a boss it will give you an drop like dungeon quest because i cant find a single video of drops like dungeon quest for inv
Fr
just make that killing the boss opens a door and put a chest that gives you some stuff
Hey! Can u make tutorial on how to add when the player kills npc they get something and itgoes to inventory
Great video, can you make like an hotbar where items that you equip are shown?
Will you make a tutorial on how to make pets?
it says "fireserver can only be called from a client" can someone pls help
make it a local script
game.Players.PlayerAdded:Connect(function(player)
local inventory = Instance.new("Folder", player)
inventory.Name = "Inventory"
end)
InventoryScript code:
local InventoryEvent = game.ReplicatedStorage.Remotes.InventoryEvent
game.Players.PlayerAdded:Connect(function(player)
local inventory = player:WaitForChild("Inventory")
local inventoryFrame = player.PlayerGui:WaitForChild("MenuGui").InventoryFrame.ItemsFrame:GetChildren()
inventory.ChildAdded:Connect(function(Item)
InventoryEvent:FireClient(player, Item , true)
end)
end)
InventoryEvent.OnServerEvent:Connect(function(player, ItemName, Value, button)
if Value == false then
local SelectedItem = player.Inventory:FindFirstChild(ItemName)
local backpack = player.Backpack:GetChildren()
local stuff = player.Character:GetChildren()
if #backpack == 0 and not player.Character:FindFirstChildWhichIsA("Tool") then
button.Text = "Unequip"
button.BackgroundColor3 = Color3.new(255,0,0)
SelectedItem:Clone().Parent = player.Backpack
else
for i,v in ipairs(backpack) do
button.Text = "Equip"
button.BackgroundColor3 = Color3(0,255,0)
v:Destroy()
end
end
end
end)
inventory local script:
local InventoryEvent = game.ReplicatedStorage.Remotes.InventoryEvent
local itemFrame = script.Parent:FindFirstChild("ItemsFrame")
InventoryEvent.OnClientEvent:Connect(function(ItemName, Value)
if Value == true then
local ItemButton = script.Parent.ItemsFrame.ItemButton:Clone()
ItemButton.Visible = true
ItemButton.Name = ItemName.Name
ItemButton.Text = ItemName.Name
ItemButton.Parent = itemFrame
local equipButton = script.Parent.EquipItemsFrame["Equip Button"]
ItemButton.MouseButton1Click:Connect(function()
script.Parent.EquipFrame.Title.Text = ItemName.Name
script.Parent.EquipFrame.Title.Visible = true
equipButton.Visible = true
end)
end
end)
will add other code later
35
Reply
7 replies
@404-mz2ly
4 months ago
Thank you! I finally made a inventory! I was struggled, but I fix it! Ty
1
Reply
@BlueGuy_102
11 months ago
underrated
3
Reply
@ameliezhang-ku2zr
2 months ago
i struggled throughout the video but i made it!! Im planning on publishing a game in roblox! tysm!!!!!
Reply
@001i7
11 months ago
This is very useful, but can you create a tool tool? would fit perfectly with your inventory system
5
Reply
@Mosio_RBLX
6 months ago
game.Players.PlayerAdded:connect(function(player)
local inventory = Instance.new(''Folder'',player)
inventory.Name = ''Inventory
end)
Heres the leaderstats script
6
Reply
Mirixas
·
8 replies
@kisub2307
3 months ago
Leaderstats code :
game.Players.PlayerAdded:Connect(function(player)
local inventory = Instance.new("Folder", player)
inventory.Name = "Inventory"
end)
InventoryScript code:
local InventoryEvent = game.ReplicatedStorage.Remotes.InventoryEvent
game.Players.PlayerAdded:Connect(function(player)
local inventory = player:WaitForChild("Inventory")
local inventoryFrame = player.PlayerGui:WaitForChild("MenuGui").InventoryFrame.ItemsFrame:GetChildren()
inventory.ChildAdded:Connect(function(Item)
InventoryEvent:FireClient(player, Item , true)
end)
end)
InventoryEvent.OnServerEvent:Connect(function(player, ItemName, Value, button)
if Value == false then
local SelectedItem = player.Inventory:FindFirstChild(ItemName)
local backpack = player.Backpack:GetChildren()
local stuff = player.Character:GetChildren()
if #backpack == 0 and not player.Character:FindFirstChildWhichIsA("Tool") then
button.Text = "Unequip"
button.BackgroundColor3 = Color3.new(255,0,0)
SelectedItem:Clone().Parent = player.Backpack
else
for i,v in ipairs(backpack) do
button.Text = "Equip"
button.BackgroundColor3 = Color3(0,255,0)
v:Destroy()
end
end
end
end)
inventory local script:
local InventoryEvent = game.ReplicatedStorage.Remotes.InventoryEvent
local itemFrame = script.Parent:FindFirstChild("ItemsFrame")
InventoryEvent.OnClientEvent:Connect(function(ItemName, Value)
if Value == true then
local ItemButton = script.Parent.ItemsFrame.ItemButton:Clone()
ItemButton.Visible = true
ItemButton.Name = ItemName.Name
ItemButton.Text = ItemName.Name
ItemButton.Parent = itemFrame
local equipButton = script.Parent.EquipItemsFrame["Equip Button"]
ItemButton.MouseButton1Click:Connect(function()
script.Parent.EquipFrame.Title.Text = ItemName.Name
script.Parent.EquipFrame.Title.Visible = true
equipButton.Visible = true
end)
end
end)
this is not my sode but i copied it so i could watch the vid and copie this at the same time
3
Reply
@DogeGamingYt2014
11 months ago
Nice😊
3
Reply
@MAINZ-nz5uu
11 months ago
Really useful, even for pros😂
3
Reply
@Lala_produdeplayz-wy6gb
2 months ago
noice
It didn't work for me
Then you did it wrong
it didn't work for me, when i tested it when i was done it stayed there randomly
CAN YOU PLEAS MAKE IT SAVE THE INVENTORY WHEN A PLAYER REJOINS?? I REALLY NEED IT PLSS
If u find it pls tell me
can you add datasave?
And how to make inventory Item button using an image of the item?
use image button instead of text button
the uigridlayout changes the position of my textbutton can you help?
nah its alr js classic me being stupid
and how to make when you equip item from inventory that just not to show staterpack?
your problem is what i am looking and the one you lookin is my problem XD
@Mirixas do you know what possibly could’ve gone wrong when the inventory doesn’t disappear after finishing all the scripts?
can you make a video on how to make a custom hotbar please?
How to make an open the inventory by a keyboard button like a , f in the keyboard or r. I need help
use chat gpt and say "edit this script to execute remote event" and paste in the script as a substitute to the open inventory button
Nice😊
i cant get into the inventory and it says no error just warning but warning says
How can i made you can only have one sword in hand and all in inventory??
noice
liked it
I cant seems to open and close the inventory i did exactly what you said in the vid help
When I claim it it didn't come in my Inventory 😢 pls help
It's come in my down box but it's didn't come in my Inventory
me too
yeah same, i was wondering that there should be more than 1 event
why when i testing this , scripts in server scripts service are disappearing?
because when you put a script inside of ServerScriptService when you run the game it will disepear but it will still run
i cant see what he wrote at 8:10
Will this broken when this uses to tools that changes itself names further?
I mean the in my game the tools when it’s on cooldown it will change the name as “Cooldown!”, can it breaks when the tool name was cooldown and player Unequip and equip again causes script stack end or duplicated tools?
What?
part 6 of clicker simulator?
Bro we can't copy it 8:11. its blurry.
check your monitor
UP YOUR BLOODY RES
Help me I have a inventory and I can enter to them but I can't take sword to my inventory
How would you be able to add a icon? Tutorial Is Very Helpful btw
When i press equip the script turns the button to unequip but the sword is not placed in my characters hotbar to use
You need to place the sword copy in the player backpack (example: Sword.Parent = player.backpack)
ty
Can someone tell me how I the sword disappeared but it isn’t in my inventory
can you show how to make bladeball game in roblox studio
unequip button is not working why?
Hello! Nice tutorial, but at 5:49, it is a bit hard to see the end script, so you could make it easier to see on the next videos. Overall good video, keep it up!
all you have to do is go to settings then quality and then put it at 1080p60
Can you please make this a model and send?
0:31
Inventory guy
What is the MenuGui
I thought that too but when he is fixing the gui he put something else
Hey you! Since 2023 is over... please make a tutorial on making a clicker game on roblox studio for 2024!
The 2023 version still works perfectly fine for 2024
@@Mirixas thanks.
do part 8 where you teach us how to make a upgrade tab with a container that allows the player to scroll through the upgrades.
@@Mirixas can you make it a model?
hi
someone give me the 6:20 script please
Can you make Item Saves?
did everything the exact same way and dont works
Then you didnt
How to make it so you can have more than one item.
You are doing this to fast
Slow the video down
@@DuckYzYTChanja
If only this was a prerecorded video where you could pause or slow it down 😪
Nice
If you guys see this comment and don't know how to save on death then go to the screen guy and set ResetOnDeath to false
I just don't know how to save when leaving
making guys is so hard!!
why wont it work? that took me an hole hour to make this..
L instead of saying it won't work STATE THE PROBLEM
Dont works
save inventary?
fake because there is nothing called "Inventory" inside the player
Won't even say anything to that 🤦
@@Mirixas fr
5:46
pls click sim tutorial
This is not my main account but the script do work
4:55
Unable to assign property Name. string expected, got Instance - Client - InventoryLocalScript:9
why?
Link Uncopylocked pls
next part pleeese
3:26
8:54
Nice but i made it to open by pressing T
does not wok for me the weapons are not going inside of the inventory frame
@@smoggypanda4000 well yeah i created a different script for it
@@TeleVision-ho3cy can you comment it
@@smoggypanda4000 -- LocalScript inside the i forgot but just play around on where to put it like inventory frame or smth then name it PressInventory
local UserInputService = game:GetService("UserInputService")
local inventoryFrame = script.Parent:WaitForChild("InventoryFrame")
-- Initially hide the inventory
inventoryFrame.Visible = false
-- Function to toggle inventory visibility
local function toggleInventory()
inventoryFrame.Visible = not inventoryFrame.Visible
end
-- Detect key press
UserInputService.InputBegan:Connect(function(input, gameProcessed)
if not gameProcessed then -- Check that the key press is not being used by other UI elements
if input.KeyCode == Enum.KeyCode.E then
toggleInventory()
end
end
end)
@@smoggypanda4000 here
--insert a LocalScript inside the StarterGui name it PressInventory
local UserInputService = game:GetService("UserInputService")
local inventoryFrame = script.Parent:WaitForChild("InventoryFrame")
-- Initially hide the inventory
inventoryFrame.Visible = false
-- Function to toggle inventory visibility
local function toggleInventory()
inventoryFrame.Visible = not inventoryFrame.Visible
end
-- Detect key press
UserInputService.InputBegan:Connect(function(input, gameProcessed)
if not gameProcessed then -- Check that the key press is not being used by other UI elements
if input.KeyCode == Enum.KeyCode.E then
toggleInventory()
end
end
end)
Comes with explanation so that you wont have to rely on copy and past
Dosent work, dont use this script.
The grammar says everything😭
@@Mirixas what grammar is lil bro talking about lmao
Yes it does
Doesn’t*
Bro didn't work L
L
Is it really that hard just to put the scripts in the description. People dont understand you cant zoom in on the computer so its hard to see, and its insane to be going back and forth to video then back to the script trying to follow along.
L video
Is it that hard to just rewrite the script by yourself? What about you just try to write the script, before complaining that "its hard to see" when you haven't even watched the video and just want to CTRL C + CTRL V the script. If you don't like it then you can go ahead and learn how to make the inventory system yourself. And if you have problems going back and forth then just remember, that the PAUSE button exists.
@@Mirixas well i found Its dozens of videos of people doing it while adding the script in description , so who cares. its people probably clicked on this video and seen you had no scripts in description and left. I literally found a video of some doing this in 5 min video. boom bam done. sooooooo i like and subscribed to them instead of a lil punk like you
@@Mirixas yeah it is
@@Mirixas Crazy how people wanna make roblox games and just decide that they dont want to learn how to code in the slightest bit
local title = script.Parent.Parent.title
local InventoryEvent = game.ReplicatedStorage.remotes.invntroyEvent
script.Parent.MouseButton1Click:Connect(function()
InventoryEvent:FireServer(title.Text, false, script.Parent)
end)
Can someone make it as a model then send the link to me via discord or youtube TY!
DO IT YOURSELF YOU LAZY BUM
local InventoryEvent = game.ReplicatedStorage.InventoryEvent
game.Players.PlayerAdded:Connect(function(player)
local inventory = player:WaitForChild("Inventory")
local InventoryFrame = player.PlayerGui.MenuGui.InventoryFrame.ItemFrame:Getchildren()
inventory.ChildAdded:Connect(function(Item)
InventoryEvent:FireClient(player, Item, true)
end)
end)
InventoryEvent.OnServerEvent:connect(function(player, Item, Value, button)
if Value == false then
local SelectedItem = player.Inventory:FindFirstChild(ItemName)
local backpack = player.Backpack:GetChildren()
local stuff = player.Character:GetChildren()
if #backpack == 0 and not player.Character:FindFirstChildWichIsA("Tool") then
button.text = "Unequip"
button.BackgroundColor3 = Color3.new(255,0,0)
SelectedItem:Clone().Parent = player.Backpack
else
for i,v in ipairs(stuff) do
if v:IsA("Tool") then
button.text = "Equip"
button.BackgroundColor3 - Color3.new(0,255,0)
v:destroy()
end
end
end
end
end)
THANK ME LATER
new discord link?
script.parent.MouseButton1Click:Connect(function()
script.Parent.Parent.invntoryFrame.Visible = not script.Parent.Parent.invntoryFrame.Visible
end)
the selectedItem isnt being cloned can someone help?
4:25