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
|
  |
| 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 |
|
|
|
| 04 Jul 2013 07:39 AM |
^ "Game" is not capitalized.
~That sneaky fluffy programmer!~ |
|
|
| Report Abuse |
|
|
|
| 04 Jul 2013 11:15 AM |
stuff = game.Players:getChildren if (stuff.ClassName == "Tool" or "HopperBin") then print 'Found ..stuff.Name!' |
|
|
| Report Abuse |
|
|
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
|
  |
| 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 |
|
|
|
| 04 Jul 2013 12:27 PM |
| Game is always lowercase. You check YOUR stuff. |
|
|
| Report Abuse |
|
|
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 |
|
|
|
| 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
|
  |
| 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 |
|
|
|
| 04 Jul 2013 03:23 PM |
| Game or game. Both work fine. |
|
|
| Report Abuse |
|
|
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
|
  |
| 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
|
  |
| 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
|
  |
| Joined: 21 Mar 2011 |
| Total Posts: 1368 |
|
|
| 05 Jul 2013 12:43 PM |
| Ok, No problem! No hard feelings :) |
|
|
| Report Abuse |
|
|
|
| 27 Oct 2013 12:28 PM |
| But how can you make a LocalScript to do that... like for a restricted seat? |
|
|
| Report Abuse |
|
|