generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Game Creation and Development » Scripting Helpers
Home Search
 

Re: Inventory help

Previous Thread :: Next Thread 
Sprinted is not online. Sprinted
Joined: 17 Apr 2013
Total Posts: 89
13 Aug 2013 03:30 PM
So, I'm trying to script an Inventory for my game but I'm stuck.
I need help with a script which finds the next slot if the first slot is empty
and puts it it that slot.
Please help.
Report Abuse
blackshockwave is not online. blackshockwave
Joined: 16 Mar 2012
Total Posts: 1381
13 Aug 2013 03:34 PM
I tryethat.I'md doing that.I'm saving that for later.It's a bit hard for me.Maybe you can learn something from this


inventorystuff = {}
boxes = {2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17 ,18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29
, 30, 31, 32, 33, 34, 35}
gui = script.Parent.Template

--[[SETTING INVENTORYSTUFF]]--

for i,v in pairs(plr.Backpack:GetChildren()) do
wait()
table.insert(inventorystuff, v.TextButton.Value)
end

--[[SETTING GUI LOOK]]--
for i,v in pairs(inventorystuff) do
wait()
for a = 1,#boxes do
wait()
gui:findFirstChild("Box"..a).TextButton.Text = v
end
end
Report Abuse
blackshockwave is not online. blackshockwave
Joined: 16 Mar 2012
Total Posts: 1381
13 Aug 2013 03:34 PM
Sorry for the typos.
Report Abuse
Sprinted is not online. Sprinted
Joined: 17 Apr 2013
Total Posts: 89
31 Aug 2013 07:23 AM
Bump
Report Abuse
killajake25 is not online. killajake25
Joined: 31 Jan 2011
Total Posts: 1713
31 Aug 2013 07:25 AM
I use this for my game. I put it into a brick that goes in workspace which you click (Only works once)

function give(playerWhoClicked)
for i=1,14 do
local slot = playerWhoClicked.PlayerGui.Inv.Frame:findFirstChild("Slot"..i)
if slot.Empty.Value == true then
if done == false then
slot.Empty.Value = false
slot.Gear.Value = true
slot.Item.Value = tool
done = true
end
end
end
end

You'll need to play about with it for it to work for you, though.
Report Abuse
Sprinted is not online. Sprinted
Joined: 17 Apr 2013
Total Posts: 89
31 Aug 2013 07:48 AM
bump
Report Abuse
adammthomas2000 is not online. adammthomas2000
Joined: 24 Feb 2013
Total Posts: 454
31 Aug 2013 08:07 AM
Are you talking about scrolling Gui?
Report Abuse
Sprinted is not online. Sprinted
Joined: 17 Apr 2013
Total Posts: 89
31 Aug 2013 08:14 AM
No
Report Abuse
Sprinted is not online. Sprinted
Joined: 17 Apr 2013
Total Posts: 89
31 Aug 2013 05:55 PM
Bump
Report Abuse
Sprinted is not online. Sprinted
Joined: 17 Apr 2013
Total Posts: 89
01 Sep 2013 06:57 AM
Bump
Report Abuse
Sprinted is not online. Sprinted
Joined: 17 Apr 2013
Total Posts: 89
01 Sep 2013 10:55 AM
Bump
Report Abuse
Sprinted is not online. Sprinted
Joined: 17 Apr 2013
Total Posts: 89
01 Sep 2013 12:44 PM
Someone help.
Report Abuse
killajake25 is not online. killajake25
Joined: 31 Jan 2011
Total Posts: 1713
01 Sep 2013 05:00 PM
This works for me. You just need to change the locations, names and properties and it should work.
Place it in a Clicking Brick. It's simple enough to change to an onTouch too.

function give(playerWhoClicked)
for i=1,14 do
local slot = playerWhoClicked.PlayerGui.Inv.Frame:findFirstChild("Slot"..i)
if slot.Empty.Value == true then
if done == false then
slot.Empty.Value = false
slot.Gear.Value = true
slot.Item.Value = tool
done = true
end
end
end
end
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripting Helpers
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image