|
| 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
|
  |
| 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 |
|
|
|
| 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
|
  |
| 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 |
|
|
|
| 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
|
  |
| 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 |
|
|
|
| 29 Jul 2012 08:44 PM |
| Is it possible, that You can't access other Players' PlayerGuis via a LocalScript? |
|
|
| Report Abuse |
|
|
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 |
|
|
|
| 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
|
  |
| Joined: 28 Feb 2010 |
| Total Posts: 1105 |
|
| |
|