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: probably a stupid mistake but

Previous Thread :: Next Thread 
teamkilled is not online. teamkilled
Joined: 14 Apr 2013
Total Posts: 1748
13 Nov 2013 09:47 PM
idk what's wrong with this:

if plyr:IsInGroup(913186) then
plyr.PlayerGui.NotGroup.Background.Visible = false
end

--
This is located in the starterpack so that every time a player respawns it checks if they are in the group and if they are it removes the error message locaated in startergui, but idk whats wrong
Report Abuse
tangyboxhead is not online. tangyboxhead
Joined: 23 Oct 2011
Total Posts: 9437
13 Nov 2013 09:52 PM
I thought its PLR not PLYR
Report Abuse
Scriptural is not online. Scriptural
Joined: 06 Sep 2013
Total Posts: 2979
13 Nov 2013 09:55 PM
@Tang
Its a variable

PLR = "SO WOW"
print(PLR)

PLYR = "SO WOW"
print(PLYR)
Report Abuse
teamkilled is not online. teamkilled
Joined: 14 Apr 2013
Total Posts: 1748
13 Nov 2013 09:56 PM
No it's plyr

But Im uncertain whether I can use the same variable and that's why it's messing up
Report Abuse
shonclub is not online. shonclub
Joined: 05 Sep 2009
Total Posts: 1331
13 Nov 2013 09:57 PM
Indeed a mistake, but not stupid. Making mistakes is how one learns.

Anyways, enough with the wisdom.

plyr isn't defined

There are two methods that come to my mind right now.

Method 1:

repeat wait() until script.Parent.Parent
if script.Parent.Parent:IsInGroup(913186) then
script.Parent.Parent.PlayerGui.NotGroup.Background.Visible = false
end

Method 2:

game.Players.PlayerAdded:connect(function(plr) -- plr refers to the player that has joined the server, so it is defined
if plr:IsInGroup(913186) then
plr.PlayerGui.NotGroup.Background.Visible = false
end
Report Abuse
shonclub is not online. shonclub
Joined: 05 Sep 2009
Total Posts: 1331
13 Nov 2013 09:57 PM
The first method has to be in startergui or starterpack

The second method does not.
Report Abuse
teamkilled is not online. teamkilled
Joined: 14 Apr 2013
Total Posts: 1748
13 Nov 2013 09:59 PM
Well I'm trying to make it so that it checks and removes the GUI every time the player spawns, so method 1 would work for that, correct?
Report Abuse
shonclub is not online. shonclub
Joined: 05 Sep 2009
Total Posts: 1331
13 Nov 2013 10:01 PM
Yes.

Btw, method 2 should have end) not end on one of it
Report Abuse
TheDuckOfYork is not online. TheDuckOfYork
Joined: 07 Jan 2012
Total Posts: 6599
13 Nov 2013 10:50 PM
game.Players.PlayerAdded:connect(function(player)
player.CharacterAdded:connect(function(character)
if player:IsInGroup(913186) then
player.PlayerGui.NotGroup.Background.Visible = false
end

end)
end)


maybe??
Report Abuse
TheDuckOfYork is not online. TheDuckOfYork
Joined: 07 Jan 2012
Total Posts: 6599
13 Nov 2013 10:52 PM
gah, nvm, sorry.

Didn't read the rest of your post, most of my above post is unneeded
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