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 » Scripters
Home Search
 

Re: PlayerGui is not a valid member of Player (What?)

Previous Thread :: Next Thread 
88GB is not online. 88GB
Joined: 03 Oct 2011
Total Posts: 1465
31 Mar 2015 12:37 PM
B1.MouseButton1Click:connect(function()
if E.Value > 69 then
if t == 0 then
t = 1
E.Value = E.Value - 70
for index,player in pairs(game.Players:GetPlayers()) do
if player ~= game.Players.LocalPlayer then
if (player.Character.Torso.Position-game.Players.LocalPlayer.Character.Torso.Position).magnitude < 25 then
local blind = game.ReplicatedStorage.GUIs.Blind:Clone()
blind.Parent = player.PlayerGui
end
end
end
wait(.2)
t = 0
end
end
end)

Line 15 errors. 'PlayerGui is not a valid member of Player' I really don't get it. If I used WaitForChild it might never load and the script would break/load forever.
Report Abuse
88GB is not online. 88GB
Joined: 03 Oct 2011
Total Posts: 1465
31 Mar 2015 12:42 PM
Bahmp. Any suspicious lines?
Report Abuse
epicbreaker is not online. epicbreaker
Joined: 23 Apr 2011
Total Posts: 2791
31 Mar 2015 12:43 PM
Player:WaitForChild("PlayerGui")

It will load. The PlayerGui will always exist on the client.
Report Abuse
88GB is not online. 88GB
Joined: 03 Oct 2011
Total Posts: 1465
31 Mar 2015 12:52 PM
Like I said, I put that it, it doesn't error, it bugs. The requested resource never loads. Can PlayerGui's not be accessed from LocalScripts or something? ROBLOX is acting up again..!


It 'works' the first time, meaning it removes 70 energy, but I doubt it blinds any nearby players. It never works again. Like I said, 'PlayerGui' is not a valid member of 'Player'


What the heck is wrong with ROBLOX...

Bump
Report Abuse
epicbreaker is not online. epicbreaker
Joined: 23 Apr 2011
Total Posts: 2791
31 Mar 2015 12:55 PM
You can either use WaitForChild(), which does exist for every player.. But may not be visible on another client with FE (I'm not sure about this).

You could also use a RemoteEvent, and fire the player reference over to the server, after you've done the magnitude check.
Report Abuse
88GB is not online. 88GB
Joined: 03 Oct 2011
Total Posts: 1465
31 Mar 2015 12:56 PM
Ugh. I always have to do it the hard way.


But interestingly enough, why is this happening?

Roblox bugging up again?
Report Abuse
epicbreaker is not online. epicbreaker
Joined: 23 Apr 2011
Total Posts: 2791
31 Mar 2015 12:57 PM
It's nothing to do with ROBLOX.

If you have FE enabled, it may be exactly what I said.
Report Abuse
88GB is not online. 88GB
Joined: 03 Oct 2011
Total Posts: 1465
31 Mar 2015 01:00 PM
e.e

I don't have FilteringEnabled on. Heck, I don't even know what it does.

Explain what happened when PlaceRebuilder said ROBLOX broke his new update? They could be toying around with this.
Report Abuse
88GB is not online. 88GB
Joined: 03 Oct 2011
Total Posts: 1465
31 Mar 2015 01:05 PM
Hey, uh, I'm issues getting some one to join me in my game to diagnose the problem and see if what I did fixed it. Any of you scripters mind following me for a quick sec? I appreciate it.
Report Abuse
Kapitanovas is not online. Kapitanovas
Joined: 09 Sep 2012
Total Posts: 4216
31 Mar 2015 01:10 PM
lol about to ask about FE and then just saw that u said it's not On XD
anyway...
just do

if player.PlayerGui then
end

"My Life is going Good... but..."
Report Abuse
EgoMoose is not online. EgoMoose
Joined: 04 Feb 2009
Total Posts: 2896
31 Mar 2015 01:10 PM
You can't access other client's PlayerGui from a different client.

You'll need to access it from with a server script (or something along those lines, remote function, remote event).
Report Abuse
epicbreaker is not online. epicbreaker
Joined: 23 Apr 2011
Total Posts: 2791
31 Mar 2015 01:10 PM
He probably decided to use PlayerScripts.

FilteringEnabled prevents Client-Server/Vice-versa communication. You can only do it with RemoteEvents/Functions.
http://wiki.roblox.com/index.php?title=RemoteFunction_and_RemoteEvent_Tutorial

It's primarily used to prevent a few exploits, such as destroying parts in your game, and changing the colour.

Report Abuse
epicbreaker is not online. epicbreaker
Joined: 23 Apr 2011
Total Posts: 2791
31 Mar 2015 01:11 PM
@Kap, You should really starting checking, what you said would error.

if player:FindFirstChild("PlayerGui") then*
Report Abuse
Kapitanovas is not online. Kapitanovas
Joined: 09 Sep 2012
Total Posts: 4216
31 Mar 2015 01:12 PM
lol XD
in hurry today :/

"My Life is going Good... but..."
Report Abuse
88GB is not online. 88GB
Joined: 03 Oct 2011
Total Posts: 1465
31 Mar 2015 01:12 PM
No, I didn't use PlayerScripts.


I didn't know about the Client thing, thanks. I'm trying to use RemoteEvents.

If some one could follow me for 1 minute to see if it works, I'd be grateful.


But thanks for all the help guys.
Report Abuse
Kapitanovas is not online. Kapitanovas
Joined: 09 Sep 2012
Total Posts: 4216
31 Mar 2015 01:14 PM
am coming! XD

"My Life is going Good... but..."
Report Abuse
robocu3 is not online. robocu3
Joined: 13 Mar 2009
Total Posts: 6485
31 Mar 2015 01:16 PM
PlayerGui is regenerated upon spawn.
If you're referencing it post death in a script that hasn't been disabled and re-enabled/you don't redefine PlayerGui and all of it's descendants variables, it will cease to work without error.
I'm not sure if that's your problem, just giving some information.

-=Robo=-
Report Abuse
robocu3 is not online. robocu3
Joined: 13 Mar 2009
Total Posts: 6485
31 Mar 2015 01:17 PM
If it's not regenerating, I don't know what to tell you.
Try putting some prints to see if it's continuing execution.

-=Robo=-
Report Abuse
88GB is not online. 88GB
Joined: 03 Oct 2011
Total Posts: 1465
31 Mar 2015 01:18 PM
Using RemoteEvents worked.

Thanks for the help guys, and testers c:
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripters
   
 
   
  • 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