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: Really Weird Error

Previous Thread :: Next Thread 
thecaptain97 is not online. thecaptain97
Joined: 17 Jun 2010
Total Posts: 4987
29 Jul 2012 08:35 PM
Output:

20:34:25 - PlayerGui is not a valid member of Player
20:34:25 - Script "Players.thecaptain97.PlayerGui.Promo Application.PromoFrame", Line 20
20:34:25 - stack end
20:34:25 - Disconnected event because of exception

----------------

Script:

frame = script.Parent
gui = frame.Parent
pmframe = gui.PMFrame
answerframe = gui.AnswerFrame
curRank = frame.CurrentRank
wantRank = frame.WantRank
reason = frame.Reason
sendHR = frame.HR
Close = frame.close
Send = frame.send
-- Hia Thar Fewlz

Close.MouseButton1Down:connect(function()
frame.Visible = false
end)

Send.MouseButton1Down:connect(function()
if (game.Players:findFirstChild(sendHR.Text)) then
curHR = game.Players[sendHR.Text]
if (curHR.PlayerGui:findFirstChild("Promo Application")) then-- LINE 20!
HRgui = curHR.PlayerGui["Promo Application"]
HRgui.PMFrame.Visible = true
pm = HRgui.PMFrame
pm.Reason.Text = reason.Text
pm.WantedRank.Text = wantRank.Text
pm.Sender.Text = game.Players.LocalPlayer.Name
pm.CurrentRank.Text = curRank.Text
pm.send0r.Value = game.Players.LocalPlayer
end
end
end)
Report Abuse
Dr01d3k4 is not online. Dr01d3k4
Joined: 11 Oct 2007
Total Posts: 17916
29 Jul 2012 08:37 PM
Try:
if ((curHR == nil) or (curHR.ClassName ~= "Player")) then return; end
Report Abuse
thecaptain97 is not online. thecaptain97
Joined: 17 Jun 2010
Total Posts: 4987
29 Jul 2012 08:38 PM
But right Here solves that?

if (game.Players:findFirstChild(sendHR.Text)) then
curHR = game.Players[sendHR.Text]
Report Abuse
Dr01d3k4 is not online. Dr01d3k4
Joined: 11 Oct 2007
Total Posts: 17916
29 Jul 2012 08:40 PM
O.o

Blame the night dentist. (If you were in my Spanish class, you'd understand ;))
Report Abuse
thecaptain97 is not online. thecaptain97
Joined: 17 Jun 2010
Total Posts: 4987
29 Jul 2012 08:41 PM
I've never seen this Error, and how is it even Possible in this Situation, when I know the Player has a PlayerGui?
Report Abuse
Dr01d3k4 is not online. Dr01d3k4
Joined: 11 Oct 2007
Total Posts: 17916
29 Jul 2012 08:43 PM
print(curHR:findFirstChild("PlayerGui") and "Has player gui" or "No player gui wth");
Report Abuse
thecaptain97 is not online. thecaptain97
Joined: 17 Jun 2010
Total Posts: 4987
29 Jul 2012 08:44 PM
Is it possible, that You can't access other Players' PlayerGuis via a LocalScript?
Report Abuse
Dr01d3k4 is not online. Dr01d3k4
Joined: 11 Oct 2007
Total Posts: 17916
29 Jul 2012 08:45 PM
Maybe, but I'll let somebody else answer that as I have no idea.
Report Abuse
thecaptain97 is not online. thecaptain97
Joined: 17 Jun 2010
Total Posts: 4987
29 Jul 2012 08:50 PM
And in the LocalScript, I did this to Test:

if (curHR:findFirstChild("PlayerGui")) then
print("Has PlayerGui")
else
print("No PlayerGui!?")
end

And it printed:

No PlayerGui!?
Report Abuse
stefi51 is not online. stefi51
Joined: 28 Feb 2010
Total Posts: 1105
29 Jul 2012 09:57 PM
That's impossible .-.
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