So I am new at lua and was figuring out how to make a gui for gamepass owners only. This is my script, no errors but it's not working (note that it was a studio test.)
wait(1)
gamepassid = 7106056
MPS = game:GetService("MarketplaceService")
function respawned(char)
local player = game.Players:FindFirstChild(char.Name)
if char:FindFirstChild("Head") ~= nil then
if MPS:UserOwnsGamePassAsync(player.UserId, gamepassid) then
print"Player has Gamepass"
script.Parent.Visible = true
end
else
print"Player does not have gamepass."
end
end
game.Workspace.ChildAdded:connect(respawned)
And it's annoying because the title made me do stuff and I didn't want to type the actual meaning of GUI.
