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
|
  |
| 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
|
  |
| 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 |
|
|
|
| 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
|
  |
| Joined: 04 Apr 2012 |
| Total Posts: 1469 |
|
| |
|