So Im trying to create an infinite bag just like simulators have, and if a player own a gamepass, then change the value of "Pack" to infinite or 99999999999999 or something, it doesnt work and im not sure why, could anybody help me here, It is quite urgent. Here is my script
local id = 7746555
local player = game.Players.LocalPlayer
game:GetService("MarketplaceService").PromptGamePassPurchaseFinished:Connect(function(plr,ido,purchased)
if purchased and ido == id then
wait (1)
player:WaitForChild("leaderstats").Pack.Value = 999999999
end
end)
game.Players.PlayerAdded:Connect(function(plr)
if game:GetService("MarketplaceService"):UserOwnsGamePassAsync(plr.UserId,id) then
wait (1)
player:WaitForChild("leaderstats").Pack.Value = 999999999
end
end)
The script a ServerScript and is located in the ServerScriptService

3 comments
Try replacing all "player"s with "plr"
You can't use a local script to change the leaderstats if your game is FE
^ games are "filtering enabled" whether the actual setting is enabled or not, so the term FE is not really valid anymore. Everything should be defined as Server-Client