Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

Gui is not becoming visible while I run this script?

Since the past day I've been trying to use the code for my gui it basiclly makes the gui visible when someone has the gamepass but it is not working I did everything correctly and it still not working heres my code Hope you guys find a solution to my problem~~~~~~~~~~~~~~~~~

 
game.Players.PlayerAdded:connect(function(player)
    if Game:GetService("GamePassService"):PlayerHasPass(player, id) then 
        print(player.Name .. " has the game pass!")
    else
        print(player.Name .. " doesn't have the game pass...")
    end
end)



 

2 answers

Game show be "game" and you have to make the gui visible by linking your script to the Frame or TextLabel and such then you have to make the Visible to false in the properties then make it true when the script runs it like this game.StarterGui.GamePassGui.Frame.Visible = true

1 comment

0

Thank you so much for considering to help me

You have not actually told the game to copy the gui to the gamepass owner's gui. Sorry if I place random colons anywhere, I'm used to C# too much. Here is a snippet of code that may help:

local GUI = (location of gui)
guiclone = GUI:clone();
guiclone.Parent = game.Players.LocalPlayer.PlayerGui

We then will place your if statement and then place the snippet of code in and boom!

local id = 103728213 player = game.Players.LocalPlayer

game.Players.PlayerAdded:connect(function(player) if Game:GetService("GamePassService"):PlayerHasPass(player, id) then
local GUI = (location of gui)
guiclone = GUI:clone();
guiclone.Parent = game.Players.LocalPlayer.PlayerGui
 print(player.Name .. " has the game pass!") else print(player.Name .. " doesn't have the game pass...") end end)

1 comment

0

Sorry guys if im very late But thank so you guys so much for considering to help me out

This discussion is preserved as it was. New answers, comments, and votes are closed.