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 |
|
|
|
| 05 Jun 2015 08:35 PM |
| if Hud:FindFirstChild("Backpack") |
|
|
| Report Abuse |
|
|
cntkillme
|
  |
| Joined: 07 Apr 2008 |
| Total Posts: 44956 |
|
|
| 05 Jun 2015 08:35 PM |
| :FindFirstChild("BACKPACK") |
|
|
| Report Abuse |
|
|
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
|
  |
| Joined: 18 Feb 2011 |
| Total Posts: 6103 |
|
|
| 05 Jun 2015 08:36 PM |
| God damnit. Thanks guys xD |
|
|
| Report Abuse |
|
|
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
|
  |
| 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
|
  |
| Joined: 18 Feb 2011 |
| Total Posts: 6103 |
|
|
| 05 Jun 2015 08:41 PM |
| @gergy I honestly don't really like camel case. |
|
|
| Report Abuse |
|
|
|
| 05 Jun 2015 08:45 PM |
camelCase and PascalCase > all
u should add filtering - devious |
|
|
| Report Abuse |
|
|
jode6543
|
  |
| Joined: 16 Jun 2009 |
| Total Posts: 5363 |
|
|
| 05 Jun 2015 09:07 PM |
| You forgot to turn off your siggie, Devious. |
|
|
| Report Abuse |
|
|