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: Can't find an existing Gui.

Previous Thread :: Next Thread 
DevFrank is not online. DevFrank
Joined: 04 Apr 2012
Total Posts: 1469
21 Jul 2014 04:09 PM
Ive made a script that cant find my Gui that is clearly there.

Error:

14:05:36.220 - G_Hint is not a valid member of PlayerGui
14:05:36.221 - Script 'Players.Player1.Backpack.Pickup_Check', Line 8

Code:

repeat wait()
Player = game.Players.LocalPlayer
until Player
mouse = Player:GetMouse()

repeat wait()
GrabValue = Player.Backpack.Grab_.V_Grab
G_Hint = Player.PlayerGui.G_Hint
until G_Hint and GrabValue

mouse.Move:connect(function()
local Target = mouse.Target
if Target ~= nil then
if Target.Name == "PickupItem_" or Target.Name == "Bag" then
if Target:IsA("Model") then
Player.PlayerGui.SelectionBox.Adornee = Target
Player.Backpack.Grab_.Disabled = false
G_Hint.MainFrame.Visible = true
else
Player.PlayerGui.SelectionBox.Adornee = nil
Player.Backpack.Grab_.Disabled = true
G_Hint.MainFrame.Visible = false
GrabValue.Value = 0
end
end
end
end)

GrabValue.Changed:connect(function()
if GrabValue.Value == 5 then
local Target = mouse.Target
if Target ~= nil then
Target:Destroy()
end
end
end)
Report Abuse
DevFrank is not online. DevFrank
Joined: 04 Apr 2012
Total Posts: 1469
21 Jul 2014 04:21 PM
I hate it when I get problems like this.
Report Abuse
Trioxide is not online. Trioxide
Joined: 29 Mar 2011
Total Posts: 32902
21 Jul 2014 04:23 PM
Use FindFirstChild in the repeat loop to index it.


RT'er | Scripter | Torrent Leecher | Fat Weeaboo | Kuroyukihime
Report Abuse
brinkokevin is not online. brinkokevin
Joined: 25 Jul 2012
Total Posts: 1673
21 Jul 2014 04:25 PM
localscripts are srsly fast they run befor the guis even load so the scrip dosent see that yet u have to use :FindFirstChild to detect if its there like someone said above
Report Abuse
DevFrank is not online. DevFrank
Joined: 04 Apr 2012
Total Posts: 1469
21 Jul 2014 04:40 PM
ok it works.
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