|
| 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 |
|
|
| |
|
|
| 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 |
|
|
|
| 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 |
|
|
|
| 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 |
|
|
|
| 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 |
|
|
| |
|
|
| 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 |
|
|
| |
|