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 » Scripters
Home Search
 

Re: What do you guis think?

Previous Thread :: Next Thread 
TheBoyOnTheBlock is not online. TheBoyOnTheBlock
Joined: 09 Nov 2013
Total Posts: 341
28 Jun 2014 06:57 PM
inventory = {}
maxItems = 10 -- change this to how many items you can store
currentItems = #inventory

function addItem(x)
currentItems = #inventory
if (currentItems < maxItems) then
local item = table.insert(inventory, (currentItems + 1), x)
print(x.. ' added')
currentItems = #inventory
else
print('Inventory already full.')
end
end

function removeItem(y)
currentItems = #inventory
if (currentItems < 1) then
print('Nothing to remove')
else
for i = 1, #inventory do
if inventory[i] == y then
table.remove(inventory, i)
print(y.. ' removed.')
break
end
end
currentItems = #inventory
end
end


addItem("sword")
addItem("axe")
removeItem("axe")
print(table.concat(inventory))

You can't tell me this isn't partially good. I made it so that you choose what the item is called, and what item you remove.
Report Abuse
bohdan77 is not online. bohdan77
Joined: 10 Aug 2008
Total Posts: 7944
28 Jun 2014 07:01 PM
eh, i'm not sure what we guis think. we're just visual
Report Abuse
TheBoyOnTheBlock is not online. TheBoyOnTheBlock
Joined: 09 Nov 2013
Total Posts: 341
28 Jun 2014 07:03 PM
Haaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaah I see whatcha did there.
Report Abuse
morash is not online. morash
Joined: 22 May 2010
Total Posts: 5834
28 Jun 2014 10:21 PM
I am neither graphical, meant for the user, or an interface. Sorry.
Report Abuse
COOLDUDE11OO is not online. COOLDUDE11OO
Joined: 21 Aug 2011
Total Posts: 5115
28 Jun 2014 11:16 PM
sry I'm not a GUI
Report Abuse
TheBoyOnTheBlock is not online. TheBoyOnTheBlock
Joined: 09 Nov 2013
Total Posts: 341
29 Jun 2014 08:57 AM
Sry but you fail. "gui" isn't an acronym, GUI is.
Report Abuse
TigreBlood is not online. TigreBlood
Joined: 31 Jul 2011
Total Posts: 1107
29 Jun 2014 04:58 PM
Who me
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripters
   
 
   
  • 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