Hmm. because of the background colour changing, it seems to me that the remote event is being sent over from the client. So it’s likely to be an issue on the server. Prints can be a great tool for debugging and it can tell us much more about the problem, e.g, where the issue specifically is at, what parts of the code aren’t running.
I assume you have defined the path to your remotes as well as any other services.
local MarketPlaceService = game:GetService("MarketplaceService")
local gamePassID = 12423824
local event = game.ReplicatedStorage.RemoteEvent
Event.OnServerEvent:Connect(function(Player)
local PlayerLeaderstats = Player:WaitForChild("leaderstats")
local PlayerRawStats = Player:WaitForChild("RawStats")
local Taps = PlayerLeaderstats:WaitForChild("Taps")
local Rebirths = PlayerLeaderstats:WaitForChild("Rebirths")
local TotalTaps = PlayerRawStats:WaitForChild("TotalTaps")
local ClicksPerSecond = PlayerRawStats:WaitForChild("ClicksPerSecond")
-- More likely an issue after here -- I would wrap it an pcall just in case.
local success, hasPass = pcall(function()
MarketPlaceService:UserOwnsGamePassAsync(Player.UserId, gamePassID)
end)
if not success then -- Error
else
if hasPass then -- Player has gamepass
Taps.Value = Taps.Value + ClicksPerSecond.Value * 2 * (Rebirths.Value + 1)
TotalTaps.Value = TotalTaps.Value + ClicksPerSecond.Value * 2 * (Rebirths.Value + 1)
else
-- Player doesn't have pass
Taps.Value = Taps.Value + ClicksPerSecond.Value * (Rebirths.Value + 1)
TotalTaps.Value = TotalTaps.Value + ClicksPerSecond.Value * (Rebirths.Value + 1)
end
end
end)