I've put it into the script where the cash is created too like someone suggested a while back, but it keeps working and not working (mostly not working) and i'm confused on why this is.
Can someone help?
I have multiple badges/gamepasses that I need this for and I also don't know how to put it all in one single function could someone help out with that too?
Gamepass/Badge script
game.Players.PlayerAdded:connect(function(plr) local cashmoney = game.ServerStorage.PlayerMoney:FindFirstChild(plr.Name) if game:GetService("MarketplaceService"):PlayerOwnsAsset(plr,540679791) then print(plr.Name .. " owns the VIP") if cashmoney then wait(1) cashmoney.Value = cashmoney.Value + 10000 end else print(plr.Name .. " doesn't own VIP") end end)
Thanks for your time
-Species
Hello,
I made an assumption that the player owns the gamepass. Image of game explorer : Game Explorer I also assumed that "PlayerMoney" is a folder, in which resides a NumberValue which name is = plr.Name.
game.Players.PlayerAdded:connect(function(plr) local Asset = game:GetService("MarketplaceService"):GetProductInfo('ID_HERE') --Put ID local cashmoney = game.ServerStorage.PlayerMoney:findFirstChild(plr.Name) print(Asset.Name .. " has been sold : " .. Asset.Sales.." times.") if game:GetService("MarketplaceService"):PlayerOwnsAsset(plr,'ID_HERE') then print(plr.Name .. " owns the VIP") if cashmoney ~= nil then wait(1) print(cashmoney.Name,cashmoney.Parent,plr.Name,cashmoney.Value) cashmoney.Value = cashmoney.Value + 10000 end else print(plr.Name .. " doesn't own VIP") end end)
I am still learning RbxLua.
Thank you for reading.