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: Index Global

Previous Thread :: Next Thread 
3DGamers is not online. 3DGamers
Joined: 29 Dec 2008
Total Posts: 327
23 Aug 2013 11:02 PM
Players.Player1.PlayerGui.Animate:22: attempt to index global 'exgui' (a nil value)


MoveExaime = function(Mouse)
if Mouse.Target.Parent:FindFirstChild("Examine") ~= nil and (Mouse.Target.Position - game.Players.LocalPlayer.Character.Torso.Position).magnitude < 15 then
local exgui = script.Guii
exgui.Adornee = Mouse.Target
exgui.Parent = Player.PlayerGui
exgui.Frame.ObjName.Text = Mouse.Target.Parent:FindFirstChild("Examine").Value
else
exgui.Adornee = nil --- ERROR HAPPENS WITH THIS
end
end


I don't see what's wrong..
Report Abuse
CodyTheBuildingKid is not online. CodyTheBuildingKid
Joined: 13 Dec 2011
Total Posts: 4399
23 Aug 2013 11:07 PM
Because 'exgui' is not defined in the else statement.
Report Abuse
dog456pop248 is not online. dog456pop248
Joined: 24 Aug 2008
Total Posts: 3977
23 Aug 2013 11:07 PM
Try just Adornee'ing it to its parent...?
Report Abuse
laughablehaha is not online. laughablehaha
Joined: 19 Apr 2012
Total Posts: 2495
23 Aug 2013 11:09 PM
You spelled

Gui is spelled wrong on the line where you make your variable.
Report Abuse
dog456pop248 is not online. dog456pop248
Joined: 24 Aug 2008
Total Posts: 3977
23 Aug 2013 11:11 PM
Perhaps the name of the thing he's tagging a variable to is actually called Guii?
Report Abuse
CodyTheBuildingKid is not online. CodyTheBuildingKid
Joined: 13 Dec 2011
Total Posts: 4399
23 Aug 2013 11:11 PM
Here's what you're trying to do:

if (condition) then
local a = 5
else
print(a)
end
Report Abuse
3DGamers is not online. 3DGamers
Joined: 29 Dec 2008
Total Posts: 327
23 Aug 2013 11:13 PM
So I should redefine exgui again in the else statement?
Report Abuse
CodyTheBuildingKid is not online. CodyTheBuildingKid
Joined: 13 Dec 2011
Total Posts: 4399
23 Aug 2013 11:14 PM
Yes, or before the if statement.
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