can someone help me with my script this script is in my gui button, it should make a gui frame visible when a plr clicks on a button but when a plr has gamepass it should make a vip frame visible else a free frame visible .
function Click()
local Players = game:GetService("Players")
local MarketPlaceService = game:GetService(MarketPlaceService")
local GamepassId = 10664855
function Click()
Players.PlayerAdded:Connect(function(Player)
if (MarketPlaceService:PlayerOwnsAsset(Player, GamepassId)) then
script.Parent.Parent.parent.vip.Visible = true else
script.Parent.Parent.parent.freemode.Visible = true
end
end)
script.Parent.MouseButton1Down:connect(Click)

1 comment
Is it working now?