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

Gui is not becoming visible while I run this script?

Asked by 7 years ago

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

~~~~~~~~~~~~~~~~~local id = 103728213 player = game.Players.LocalPlayer

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

Log in to vote
0
Answered by 7 years ago

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

0
Thank you so much for considering to help me activatesenju 2 — 7y
Ad
Log in to vote
0
Answered by 7 years ago
Edited 7 years ago

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)
0
Sorry guys if im very late But thank so you guys so much for considering to help me out activatesenju 2 — 7y

Answer this question