I am trying to modify the number value of a script when a player has purchased a gamepass except it modifies it for every player, how would I make it only modify for the player who bought the gamepass? I didn't think a local script would work because that makes it local and then the player can't use the money to buy stuff from my shop because it doesn't register on the server. Here is my script:

		local id = 7112014 -- Replace this with your GP id
 
game.Players.PlayerAdded:Connect(function(plr)
    plr.CharacterAdded:connect(function(char)
    if game:GetService("MarketplaceService"):UserOwnsGamePassAsync(game.Players[char.Name].UserId, id) then
    game.Workspace.CashOnKill1
end)
end)

  
 

		  
		
		
		

1 comment

0

It's obvious that this is a free model. Also that script seems kinda unfinished with that 1 there...