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 |
|
|
|
| 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 |
|
|
| |
|
Sprinted
|
  |
| Joined: 17 Apr 2013 |
| Total Posts: 89 |
|
| |
|
|
| 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
|
  |
| Joined: 17 Apr 2013 |
| Total Posts: 89 |
|
| |
|
|
| 31 Aug 2013 08:07 AM |
| Are you talking about scrolling Gui? |
|
|
| Report Abuse |
|
|
Sprinted
|
  |
| Joined: 17 Apr 2013 |
| Total Posts: 89 |
|
| |
|
Sprinted
|
  |
| Joined: 17 Apr 2013 |
| Total Posts: 89 |
|
| |
|
Sprinted
|
  |
| Joined: 17 Apr 2013 |
| Total Posts: 89 |
|
| |
|
Sprinted
|
  |
| Joined: 17 Apr 2013 |
| Total Posts: 89 |
|
| |
|
Sprinted
|
  |
| Joined: 17 Apr 2013 |
| Total Posts: 89 |
|
| |
|
|
| 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 |
|
|