|
How can I make it so the game checks if someone has a VIP gamepass then the gui would be visible? |
|
ZachBloxxJoin Date: 2013-06-26 Post Count: 2833 |
Gui > Frame > LocalScript
local Player = game.Players.LocalPlayer
local PassId = 1337
function CheckPass()
local check = false
if game:GetService("GamePassService"):PlayerHasPass(Player, PassId) then
check = true
end
return check
end
if CheckPass() then
script.Parent.Visible = true
end |
|
FriazaJoin Date: 2008-12-26 Post Count: 6229 |
--Player = script.Parent.Parent.Parent.Parent (Probably) / game.Players.LocalPlayer (for LocalScript)
PassId = ""
if game:GetService("GamePassService"):PlayerHasPass(Player, PassId) == true then
script.Parent.Visible = true
end
----
Note: If you want to do V.I.P shirts or something else then replace the GamePass line with:-
if game:GetService("MarketplaceService"):PlayerOwnsAsset(Player, PassId) == true then
|
|
ZachBloxxJoin Date: 2013-06-26 Post Count: 2833 |
@Friaza, an ID is an interger, not a string. |
|
|
Thanks guys. I already used zachs though, thanks though Friaza! |
|
|
local Player = game.Players.LocalPlayer
local PassId = 1337
function CheckPass()
local check = false
if game:GetService("GamePassService"):PlayerHasPass(Player, PassId) then
check = true
end
return check
end
if CheckPass() then
script.Parent.Visible = true
end
That can be:
local Player = game.Players.LocalPlayer
local PassId = 1337
script.Parent.Visible = game:GetService("GamePassService"):PlayerHasPass(Player, PassId) |
|
ZachBloxxJoin Date: 2013-06-26 Post Count: 2833 |
@Iterations,
shudup i leik return |
|
|
local Player = game.Players.LocalPlayer
local PassId = 1337
function CheckPass()
return game:GetService("GamePassService"):PlayerHasPass(Player, PassId)
end
script.Parent.Visible = CheckPass()
there u has return |
|
cntkillmeJoin Date: 2008-04-07 Post Count: 49450 |
Ilererations wins |
|
ZachBloxxJoin Date: 2013-06-26 Post Count: 2833 |
ok fine u win dis one but ima pwn u nxt time |
|
cntkillmeJoin Date: 2008-04-07 Post Count: 49450 |
I win:
script.Parent.Visible =game:GetService("GamePassService"):PlayerHasPass(game.Players.LocalPlayer, 1337) |
|
|
for the sake of OP i didnt put the variables inside the thingy |
|
ZachBloxxJoin Date: 2013-06-26 Post Count: 2833 |
u pwn me here so i rank u up in da group kk? |
|
|