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: Backpack a nil value?

Previous Thread :: Next Thread 
MadSanity is not online. MadSanity
Joined: 13 Nov 2009
Total Posts: 41506
27 Feb 2017 09:40 AM
This is the snippet causing me troubles.


local PlayerOne = game.Players:GetPlayers()
if PlayerOne.Backpack:FindFirstChild("PoolCue1") then
Report Abuse
HuntedAreTheHunters is not online. HuntedAreTheHunters
Joined: 18 Dec 2016
Total Posts: 23
27 Feb 2017 09:56 AM
Hi,
I am almost think that your error is being called because PlayerOne will be a table therefore it has no such value as .backpack. To call the first player in that table you find you could do

local PlayerOne = game.Players:GetPlayers()
if PlayerOne[1].Backpack:FindFirstChild("PoolCue1") then

That may work for your use!

-HuntedAreTheHunters
Report Abuse
MadSanity is not online. MadSanity
Joined: 13 Nov 2009
Total Posts: 41506
27 Feb 2017 09:59 AM
I was focusing too much on where the error was apparently
Report Abuse
Mister_Manakin is not online. Mister_Manakin
Joined: 16 Sep 2009
Total Posts: 1935
27 Feb 2017 10:06 AM
local PlayerOne = game.Players:GetPlayers()
fir _,v in pairs(PlayerOne) do
if PlayerOne.Backpack:FindFirstChild("PoolCue1") then
Report Abuse
12904 is online. 12904
Joined: 29 Oct 2012
Total Posts: 441
27 Feb 2017 10:22 AM
^ I think it is accualy if v.Backpack:FindFirstChild("PoolCue1") then
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