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: Making a gui visible based on gamepass...

Previous Thread :: Next Thread 
verbalAKspray is not online. verbalAKspray
Joined: 09 Jul 2014
Total Posts: 23685
15 Jul 2014 02:56 PM
this is supposed to make the gui visible if the person owns the gamepass. the gui that's supposed to be visible to them is a textbutton, which is a button that opens a Frame when you click it

so "Doors" is a Gui with a Frame and a Texbutton in it.

for some reason this won't work





local AssetId = 166513346
local Badge = Game:service("BadgeService")

Game.Players.PlayerAdded:connect(function(Player)
if Badge:UserHasBadge(Player.userId,AssetId) then
Player.PlayerGui.Doors.Visible = true
else
Player.PlayerGui.Doors.Visible = false
end
end)
Report Abuse
verbalAKspray is not online. verbalAKspray
Joined: 09 Jul 2014
Total Posts: 23685
15 Jul 2014 02:57 PM
.
Report Abuse
connor954 is not online. connor954
Joined: 24 Jul 2008
Total Posts: 947
15 Jul 2014 03:03 PM
Well, you put "BadgeService" not "GamepassService".

id = "IdHere"

game.Players.PlayerAdded:connect(function(id, player)
if game:GetService("GamepassService"):PlayerHasPass(player, id) then
game.StarterGui.ScreenGui.Frame.Visible = true
else
game.StarterGui.ScreenGui.Frame.Visible = false
end
end)

That should work
Report Abuse
connor954 is not online. connor954
Joined: 24 Jul 2008
Total Posts: 947
15 Jul 2014 03:07 PM
Put GamePassService instead of GamepassService.
Report Abuse
connor954 is not online. connor954
Joined: 24 Jul 2008
Total Posts: 947
15 Jul 2014 03:15 PM
That doesn't work. Sorry
Report Abuse
verbalAKspray is not online. verbalAKspray
Joined: 09 Jul 2014
Total Posts: 23685
15 Jul 2014 03:17 PM
idk.. nothing seems to work

thanks for trying tho
Report Abuse
verbalAKspray is not online. verbalAKspray
Joined: 09 Jul 2014
Total Posts: 23685
15 Jul 2014 03:18 PM
i want the button/textbutton to be visible

so that if they want the frame to be visible, they click the textbutton
Report Abuse
verbalAKspray is not online. verbalAKspray
Joined: 09 Jul 2014
Total Posts: 23685
15 Jul 2014 03:23 PM
button
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