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: Is this possible?

Previous Thread :: Next Thread 
epicpatrick123 is not online. epicpatrick123
Joined: 08 Sep 2010
Total Posts: 15039
21 Jul 2013 10:35 PM
For example, if I wanted to have this in the middle of a script:

if game:GetService("GamePassService"):PlayerHasPass(NewPlayer, 111397679) then
script.Parent.Parent.Frame2.Purchase.Visible = false

then after purchase becomes invisible, I want it to do the same thing like this

if game:GetService("GamePassService"):PlayerHasPass(NewPlayer, 123456789) then
script.Parent.Parent.Frame2.Purchase.Visible = false

but I want it to happen even if they don't have the first game pass. right now the whole script only works if you own all the game passes.
Report Abuse
epicpatrick123 is not online. epicpatrick123
Joined: 08 Sep 2010
Total Posts: 15039
21 Jul 2013 10:40 PM
ooh should i use elseif?
Report Abuse
Lamboreborn is not online. Lamboreborn
Joined: 19 Jun 2009
Total Posts: 191
21 Jul 2013 10:57 PM
You could use an "or" for your if statement.

if game:GetService("GamePassService"):PlayerHasPass(NewPlayer, 111397679) or game:GetService("GamePassService"):PlayerHasPass(NewPlayer, 123456789) then

script.Parent.Parent.Frame2.Purchase.Visible = false

end
Report Abuse
epicpatrick123 is not online. epicpatrick123
Joined: 08 Sep 2010
Total Posts: 15039
21 Jul 2013 11:19 PM
Is there a way to make it so after it sees you own it, it continues to see if you own the others? And if you do then it makes something visible? The important part is making sure it proceeds, i find it annoying since nothing i try works.
Report Abuse
epicpatrick123 is not online. epicpatrick123
Joined: 08 Sep 2010
Total Posts: 15039
22 Jul 2013 12:24 AM
I want it so when they view the game passes, it checks if they own any of them and will say "Currently Owned" (The textlabel being visible), replacing the purchase button.
Right now the script only worked with the first gamepass and I want it to continue to check after it.
Report Abuse
epicpatrick123 is not online. epicpatrick123
Joined: 08 Sep 2010
Total Posts: 15039
22 Jul 2013 12:27 AM
function clicked()
local NewPlayer = script.Parent.Parent.Parent.Parent.Parent
if script.Parent.Parent.Parent.Frame2.Visible == false then
script.Parent.Parent.Parent.Button.Visible = true
if game:GetService("GamePassService"):PlayerHasPass(NewPlayer, 111397679) then
script.Parent.Parent.Parent.Frame2.Purchase.Visible = false
script.Parent.Parent.Parent.Frame2.TextLabel.Visible = true
script.Parent.Parent.Parent.Frame2.Visible = true
elseif game:GetService("GamePassService"):PlayerHasPass(NewPlayer, 111397679) then
script.Parent.Parent.Parent.Frame3.Purchase.Visible = false
script.Parent.Parent.Parent.Frame3.TextLabel.Visible = true
script.Parent.Parent.Parent.Parent.Frame3.Visible = true
elseif game:GetService("GamePassService"):PlayerHasPass(NewPlayer, 111248841) then
script.Parent.Parent.Parent.Frame4.Purchase.Visible = false
script.Parent.Parent.Parent.Frame4.TextLabel.Visible = true
script.Parent.Parent.Parent.Parent.Frame4.Visible = true
elseif game:GetService("GamePassService"):PlayerHasPass(NewPlayer, 118532560) then
script.Parent.Parent.Parent.Frame5.Purchase.Visible = false
script.Parent.Parent.Parent.Frame5.TextLabel.Visible = true
script.Parent.Parent.Parent.Parent.Frame5.Visible = true
elseif game:GetService("GamePassService"):PlayerHasPass(NewPlayer, 111397822) then
script.Parent.Parent.Parent.Frame6.Purchase.Visible = false
script.Parent.Parent.Parent.Frame6.TextLabel.Visible = true
script.Parent.Parent.Parent.Parent.Frame6.Visible = true
else
script.Parent.Parent.Parent.Button.Visible = false
script.Parent.Parent.Parent.Frame2.Visible = false
script.Parent.Parent.Parent.Frame3.Visible = false
script.Parent.Parent.Parent.Frame4.Visible = false
script.Parent.Parent.Parent.Frame5.Visible = false
script.Parent.Parent.Parent.Frame6.Visible = false
end
end
end
script.Parent.MouseButton1Down:connect(clicked)
Report Abuse
epicpatrick123 is not online. epicpatrick123
Joined: 08 Sep 2010
Total Posts: 15039
22 Jul 2013 01:59 AM
bump
Report Abuse
notsopwnedg is not online. notsopwnedg
Joined: 07 Nov 2010
Total Posts: 4182
22 Jul 2013 02:14 AM
Don't use elseif statements because if one of them is true it skips all the rest.

So do something like this:

if has pass then
--stuff
end
if has other pass the
--OtherStuff
end

NOT THIS

if has pas then
--Stuff
elseif
--other stuff
end
Report Abuse
epicpatrick123 is not online. epicpatrick123
Joined: 08 Sep 2010
Total Posts: 15039
22 Jul 2013 10:41 AM
ok
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