I created a function which when an item is clicked it sends it to a remoteevent then it gives points to the player. The points work fine but the gui doesnt work?
local player = game.Players.LocalPlayer
local MarketplaceService = game:GetService("MarketplaceService")
local passID = 9339069
local text = game.StarterGui.RareNotifier
game.ReplicatedStorage.DominusEvent.OnServerEvent:Connect(function(player)
local pass1 = player.leaderstats.Credits.Value + 20000
local pass2 = player.leaderstats.Score.Value + 1000
local new1 = player.leaderstats.Credits.Value + 10000
local new2 = player.leaderstats.Score.Value + 1000
text.Guyxx.Visible = true
text.Guyxx.BackgroundTransparency = 0
text.Guyxx.Text = ""..player.Name.. " Found the rare Dominus Frigidus!"
if MarketplaceService:UserOwnsGamePassAsync(player.UserId, passID) then
player.leaderstats.Score.Value = pass2
player.leaderstats.Credits.Value = pass1
else
player.leaderstats.Score.Value = new2
player.leaderstats.Credits.Value = new1
end
end)

2 comments
Try using MarketPlaceService instead of MarketplaceService
I have