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: ROBLOX Lua won't even let me check this?

Previous Thread :: Next Thread 
MrSquer is not online. MrSquer
Joined: 18 Feb 2011
Total Posts: 6103
05 Jun 2015 08:34 PM
Code: if HUD.BACKPACK ~= nil then

That's a super basic "if" statement that checks if an object is real or not. If it's real, run the code. Apparently ROBLOX Lua won't let me do that though:

20:31:37.127 - BACKPACK is not a valid member of ScreenGui
20:31:37.128 - Script 'ServerScriptService.MainModule', Line 42 - field HUDBackpackUpdate
20:31:37.129 - Script 'Workspace.Game', Line 43
20:31:37.130 - Stack End

I only have this code to check because if a player respawns, it's messed up.
Why can't I do this?
Report Abuse
ShadowAley is not online. ShadowAley
Joined: 23 Jun 2010
Total Posts: 4823
05 Jun 2015 08:35 PM
if Hud:FindFirstChild("Backpack")
Report Abuse
cntkillme is not online. cntkillme
Joined: 07 Apr 2008
Total Posts: 44956
05 Jun 2015 08:35 PM
:FindFirstChild("BACKPACK")
Report Abuse
amanda is not online. amanda
Joined: 21 Nov 2006
Total Posts: 5925
05 Jun 2015 08:36 PM
Change that line to

if HUD:FindFirstChild("BACKPACK") then
Report Abuse
MrSquer is not online. MrSquer
Joined: 18 Feb 2011
Total Posts: 6103
05 Jun 2015 08:36 PM
God damnit. Thanks guys xD
Report Abuse
amanda is not online. amanda
Joined: 21 Nov 2006
Total Posts: 5925
05 Jun 2015 08:36 PM
I don't even know.. how I got double ninja'd. I've been doing so good.
Report Abuse
gergy008 is not online. gergy008
Joined: 16 Mar 2008
Total Posts: 7039
05 Jun 2015 08:37 PM
What's with the caps? Makes code look ugly and all over the place.
Report Abuse
MrSquer is not online. MrSquer
Joined: 18 Feb 2011
Total Posts: 6103
05 Jun 2015 08:41 PM
@gergy I honestly don't really like camel case.
Report Abuse
DermonDarble is not online. DermonDarble
Joined: 04 Jun 2015
Total Posts: 2576
05 Jun 2015 08:45 PM
camelCase and PascalCase > all

u should add filtering - devious
Report Abuse
jode6543 is not online. jode6543
Joined: 16 Jun 2009
Total Posts: 5363
05 Jun 2015 09:07 PM
You forgot to turn off your siggie, Devious.
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