local Players = game:GetService("Players")
local Market = game:GetService("MarketplaceService")
local PassId = 463912717
Players.PlayerAdded:connect(function(User)
if (Market:PlayerOwnsAsset(User ,PassId)) then
game.ServerStorage.ScreenGui:Clone
game.ServerStorage.ScreenGui.Parent=User.PlayerGui
end
end
end)
✓ ANSWER ACCEPTED
This gui/gamepass script is not working??? in my Escape the Art Museum Game
2 answers
✓ Accepted answer
This is how I usually do it:
game.Players.PlayerAdded:connect(function(player)
if game:GetService("MarketplaceService"):PlayerOwnsAsset(player, 0) -- 0 is the gamepass id
print(player.Name.." owns the gamepass.")
local h = game. ServerStorage['YOUR GUI']:Clone()
h.Parent = player.PlayerGui
print('Done!')
end
end)
Hopefully that helps you out!
**Thanks, ****TopRiot
You did not define a variable for the cloned object.
local Players = game:GetService("Players")
local Market = game:GetService("MarketplaceService")
local PassId = 463912717
Players.PlayerAdded:connect(function(User)
if (Market:PlayerOwnsAsset(User ,PassId)) then
local clone = game.ServerStorage.ScreenGui:clone()
clone.Parent=User.PlayerGui
end
end
end)
This discussion is preserved as it was. New answers, comments, and votes are closed.

3 comments
Anyone there?
Both work, thank you all!
You know for FE games, ReplicatedStorage is a better place to store things, especially GUIs