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: Backpack

Previous Thread :: Next Thread 
Saodo is not online. Saodo
Joined: 26 Jul 2011
Total Posts: 1206
04 Jul 2013 05:35 AM
How would you check to see if a player had a certain item/gear in their backpack?
Report Abuse
sycips is not online. sycips
Joined: 21 Mar 2011
Total Posts: 1368
04 Jul 2013 06:14 AM
itemname = "LOL" <-- you should change this...
playername = "sycips" <-- this too...

if Game.Players:findFirstChild(playername) and Game.Players[playername].Backpack:findFirstChild(itemname) then
print("It's there!")
else
print("I couldn't find the item "..itemname.." in the backpack of "..playername)
end

I hope this is what you're looking for... Enjoy :)

~sycips~
Report Abuse
Fluffmiceter is not online. Fluffmiceter
Joined: 28 Jan 2012
Total Posts: 6931
04 Jul 2013 07:39 AM
^ "Game" is not capitalized.

~That sneaky fluffy programmer!~
Report Abuse
Imacheeseburger is not online. Imacheeseburger
Joined: 16 Jun 2011
Total Posts: 142
04 Jul 2013 11:15 AM
stuff = game.Players:getChildren
if (stuff.ClassName == "Tool" or "HopperBin") then
print 'Found ..stuff.Name!'
Report Abuse
TellerMan is not online. TellerMan
Joined: 23 Apr 2010
Total Posts: 237
04 Jul 2013 11:50 AM
Put this script in StarterPack maybe... Idk I'm not great at scripting, just trying to help.

item = "ItemName"
backpack = script.Parent

backpack:findFirstChild(item)
print("Found " .. item .. "!!")
Report Abuse
sycips is not online. sycips
Joined: 21 Mar 2011
Total Posts: 1368
04 Jul 2013 12:02 PM
@Fluff

Before you say something, check whether you are right or not! 'Game' can be capitalized and can also be not capitalized!!! Don't give false information!

~sycips~
Report Abuse
EpicRichGuy is not online. EpicRichGuy
Joined: 03 May 2010
Total Posts: 1533
04 Jul 2013 12:27 PM
Game is always lowercase. You check YOUR stuff.
Report Abuse
sycips is not online. sycips
Joined: 21 Mar 2011
Total Posts: 1368
04 Jul 2013 02:31 PM
@EpicRichGuy

Stay out of it. Most people write it lowercase, but there's nothing wrong with a uppercase 'G'. You say I haven't got my facts right? Then you're a plain idiot!

~sycips~

ps I don't mean to use these words, but I don't like people who say I'm wrong even when I'm right!
Report Abuse
EpicRichGuy is not online. EpicRichGuy
Joined: 03 May 2010
Total Posts: 1533
04 Jul 2013 03:12 PM
Calling someone who has been here longer than you an idiot.

http://www.roblox.com/User.aspx?ID=1120611
Report Abuse
smiley599 is not online. smiley599
Joined: 23 Jan 2010
Total Posts: 21869
04 Jul 2013 03:21 PM
sycips is a psychopath, I've dealt with this noob before. Out, now.

Scripting Tutorials: youtube.com/user/smiley599roblox
Report Abuse
LUVMARIOLUIGI10000 is not online. LUVMARIOLUIGI10000
Joined: 16 May 2009
Total Posts: 1244
04 Jul 2013 03:23 PM
Game or game. Both work fine.
Report Abuse
smiley599 is not online. smiley599
Joined: 23 Jan 2010
Total Posts: 21869
04 Jul 2013 03:24 PM
Yep, they both work. Along with Workspace and workspace.

Scripting Tutorials: youtube.com/user/smiley599roblox
Report Abuse
sycips is not online. sycips
Joined: 21 Mar 2011
Total Posts: 1368
05 Jul 2013 10:09 AM
Smiley, don't you even read what I say? I said the same things as you guys and they said I was wrong... We are both right, but the one 'which is longer on roblox' and which thinks that's important to be a good scripter said otherwise... I've got nothing against you (although you called me something I don't really like)...

And EpicRichGuy, what if you were 1 when you joined and now you're 4 years old? You think it would still matter if you were here longer than me? Because it's obvious that what you said was wrong...

~sycips~
Report Abuse
smiley599 is not online. smiley599
Joined: 23 Jan 2010
Total Posts: 21869
05 Jul 2013 11:09 AM
No, I did read what you said. I suppose I was a bit harsh...sorry :)
Report Abuse
sycips is not online. sycips
Joined: 21 Mar 2011
Total Posts: 1368
05 Jul 2013 12:43 PM
Ok, No problem! No hard feelings :)
Report Abuse
chilledfrogs is not online. chilledfrogs
Joined: 05 Aug 2013
Total Posts: 3
27 Oct 2013 12:28 PM
But how can you make a LocalScript to do that... like for a restricted seat?
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