Learning as I build my game. Don't really know the reason why this doesn't work. Can someone help me figure out the issue?
So basically I made it so when a player owns the gamepassId it makes "ClearSongs" visible. However it isn't making the frame visible. Why's that?
local plr = game.Players.LocalPlayer
local marketplace = game:GetService("MarketplaceService")
local gamepassId = 9016487
local ClearSong = game.StarterGui.MainGui.Shop.ShopOpener.ScrollingFrame.ClearSongs
game.Players.PlayerAdded:Connect(function(plr)
if marketplace:UserOwnsGamePassAsync(plr.UserId, gamepassId) then
print("User owns victory songs")
ClearSong.Visible = true
end
end)

2 comments
ServerScriptService.ClearSongs:4: attempt to index nil with 'WaitForChild' - it's giving me this issue now
Alternatively, you can have a look at the answer on this post: https://scriptinghelpers.org/questions/106625/how-do-i-make-the-gui-visible-to-a-local-player-if-the-player-has-the-gamepass. Maybe that could do it.