Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Script To Hide 'Open GUI Button' Won't Work Properly?

Asked by
KingDomas 153
5 years ago
Edited by User#24403 5 years ago

I am making a game and I made some code for it. For some reason, this VIP gamepass script won't work. Please help!

(this is top localscript)

01local mps = game:GetService("MarketplaceService")
02local gamepass = 6549510
03VIP = false
04 
05game.Players.PlayerAdded:connect(function(player)
06while true do
07if mps:UserOwnsGamePassAsync(player.UserId, gamepass) then
08VIP = true
09end
10end
11end)
12 
13 
14if VIP == true then
15--add script here
View all 21 lines...

(this is bottom localscript)

01local mps = game:GetService("MarketplaceService")
02local gamepass = 6549510
03pparent = script.Parent.Parent
04parent = script.Parent
05VIP = false
06 
07game.Players.PlayerAdded:connect(function(player)
08while true do
09if mps:UserOwnsGamePassAsync(player.UserId, gamepass) then
10VIP = true
11else
12pparent:Destroy()
13end
14end
15end)
View all 29 lines...

These are the files: https://imgur.com/a/YQzgKzi

Basically, this is meant to make it so that if you do not have the VIP gamepass, it stops the gui from showing on the localplayer's screen. For some reason, even though I own the gamepass, it still doesn't show. Please help!

0
dont put it the gamepass check in a loop Gameplayer365247v2 1055 — 5y
0
change line 14 to if VIP then Gameplayer365247v2 1055 — 5y
0
btw connect is deprecated, instead use Connect Gameplayer365247v2 1055 — 5y
0
still doesn't work gameplayer365247 KingDomas 153 — 5y
View all comments (3 more)
0
Don't swear nerd!!!!! User#24403 69 — 5y
0
also i fixed line 30 on localscript 2 KingDomas 153 — 5y
0
this is my console rn https://imgur.com/a/JtWJXpA KingDomas 153 — 5y

1 answer

Log in to vote
0
Answered by 5 years ago

change line 14 to if VIP then

Ad

Answer this question