I've recently made a project for myself to make a ranking system for a group of mine. I came across this issue today when testing the gui, I've tried multiple solutions that I have come up with, but all seem to not work.
Script for the local script
local ID = 7771902
local Remote = game.ReplicatedStorage.MainEvent
local plr = game.Players.LocalPlayer
script.Parent.MouseButton1Click:Connect(function()
if game:GetService("MarketplaceService"):PlayerOwnsAsset(plr, ID) then
Remote:FireServer("dep")
else
game:GetService("MarketplaceService"):PromptGamePassPurchase(plr, ID)
end
end)
Script for the server script (to test if it fired, I made print statements to print out what it fires)
local Remote = game.ReplicatedStorage.MainEvent
Remote.OnServerEvent:Connect(function(user, checker)
print(user)
print(checker)
end)
