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: GUI Error Help

Previous Thread :: Next Thread 
Javeman2000 is not online. Javeman2000
Joined: 03 Sep 2008
Total Posts: 3027
30 Jul 2011 01:27 PM
My tool keeps saying that "Craft" is a nil value. I used:
local Craft=Tool:findFirstChild("Craft")
for it. Tool (also named Craft) just equals: script.Parent. (script is in the tool, named: "Crafting"). Craft is just the GUI in the tool. It keeps saying in the output:
Players.Player.Backpack.Craft.Crafting:8: attempt to index local 'Craft' (a nil value)
How can it be nil?! Plz help! D:
Report Abuse
Javeman2000 is not online. Javeman2000
Joined: 03 Sep 2008
Total Posts: 3027
30 Jul 2011 01:33 PM
Bump...>_>
Report Abuse
Ravenshield is not online. Ravenshield
Joined: 21 Nov 2007
Total Posts: 4143
30 Jul 2011 01:36 PM
It seems to me you're searching in the wrong area.

Where is the GUI contents located? In the script? If so, you'd have to do

local Craft = script:FindFirstChild("Craft")

as script.Parent would refer to the handle, and you have nothing in the Handle but the script, which is named Crafting. Therefore, it cannot find the 'Craft', and returns it as if it's a nil value,
Report Abuse
Javeman2000 is not online. Javeman2000
Joined: 03 Sep 2008
Total Posts: 3027
30 Jul 2011 01:37 PM
No, the GUI is in the Tool.
Report Abuse
Javeman2000 is not online. Javeman2000
Joined: 03 Sep 2008
Total Posts: 3027
30 Jul 2011 01:42 PM
Bump....Again? D:
Report Abuse
Ravenshield is not online. Ravenshield
Joined: 21 Nov 2007
Total Posts: 4143
30 Jul 2011 01:43 PM
Try this, then:

local ToolC = Tool:GetChildreb()
for i = 1, #ToolC do

if ToolC[i].ClassName == "GuiMain" then -- Just replace the GuiMain with whatever Gui stuff you have
local Craft = ToolC[i]

end
end


Else, you could always do a check (in your current script):

if not Craft then
print("Nope, can't find it")
else
--Your stuff--
end

It'd be easier if you posted the troublesome parts of your script, and defined where the locations of GUI and such were, in your first post.
Report Abuse
Javeman2000 is not online. Javeman2000
Joined: 03 Sep 2008
Total Posts: 3027
30 Jul 2011 01:47 PM
Ok, thanks! And btw, here's a root to the tool and stuff:
Starterpack > Craft > Crafting, Handle, Craft.
Report Abuse
Ravenshield is not online. Ravenshield
Joined: 21 Nov 2007
Total Posts: 4143
30 Jul 2011 01:50 PM
Okies, just notify me if it still don't work, and we'll try to troubleshoot it further,
Report Abuse
Javeman2000 is not online. Javeman2000
Joined: 03 Sep 2008
Total Posts: 3027
30 Jul 2011 01:57 PM
Err it still isn't working... D: I put 'if not Craft then' and this time it didn't show any errors but the GUI won't show... Here's what I put at the beginning:
local Tool=script.Parent
local deb=false
_G.Crafted={}

local player=game.Players:GetPlayerFromCharacter(Tool.Parent)
local Craft=Tool:findFirstChild("Craft")
if not Craft then
print("Craft is nil again!")
else
(Rest of my code.)
end

And I had to use GetPlayerFromCharacter(), since it's a tool and it's in my character.
Report Abuse
Javeman2000 is not online. Javeman2000
Joined: 03 Sep 2008
Total Posts: 3027
30 Jul 2011 02:05 PM
All aboard teh bump-train! Bump-Bump!!
Report Abuse
trappingnoobs is not online. trappingnoobs
Joined: 05 Oct 2008
Total Posts: 19100
30 Jul 2011 02:09 PM
Add this and tell me what happens in the output

assert(script.Parent:findFirstChild("Craft") ~= nil)
Report Abuse
Javeman2000 is not online. Javeman2000
Joined: 03 Sep 2008
Total Posts: 3027
30 Jul 2011 02:45 PM
Ok I will try that as soon as this ROBLOX Studio decides to either quit or start WORKING AGAIN from it's UNEXPECTED ERROR/HEART ATTACK!! >x3 >.<
Report Abuse
trappingnoobs is not online. trappingnoobs
Joined: 05 Oct 2008
Total Posts: 19100
30 Jul 2011 02:54 PM
If it's been 'Not responding' for more than 30 seconds, it probably won't start responding again. It's a common bug and it never recovers. I left mine all night once, when I'd done hours (I know, I know, save every 30 minutes), of work, and lost it all 3:
Report Abuse
Javeman2000 is not online. Javeman2000
Joined: 03 Sep 2008
Total Posts: 3027
30 Jul 2011 02:58 PM
@Trap, Ok I tested but nothing shows in the output. (and no GUI!! D:<)
Report Abuse
Javeman2000 is not online. Javeman2000
Joined: 03 Sep 2008
Total Posts: 3027
30 Jul 2011 03:05 PM
OK I GIVE UP! This is so stupid and rediculous how it can't even find the GUI I put RIGHT THERE IN MY TOOL! I mine as well will just delete the stupid useless tool and have a NO-CRAFTING SURVIVAL GAME! >:l
Report Abuse
Ravenshield is not online. Ravenshield
Joined: 21 Nov 2007
Total Posts: 4143
30 Jul 2011 03:07 PM
Put the GUI in the script, rather than the tool, and rename the GUI, then try again.. Always worth a try :P
Report Abuse
kaspar87 is not online. kaspar87
Joined: 16 Aug 2010
Total Posts: 69
30 Jul 2011 03:13 PM
Local tool :P
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