local productId = 20983086 local player = game.Players.LocalPlayer script.Parent.MouseButton1Click:connect(function() Game:GetService("MarketplaceService"):PromptProductPurchase(player, productId) end) if plr and plr:FindFirstChild"leaderstats" and plr.leaderstats:FindFirstChild"Credits" then plr.leaderstats.Credits.Value = plr.leaderstats.Credits.Value + script.Parent.Name end
Hey, so i have this code, were the player buy '50 credits' which i have as a developer product it opens up okay but when bought, it doesn't give the player the sed amount they bought and i don't know how to change the script to make it happen.
I don't know if you'll need it but this is the leader board, which is also working properly
function onPlayerEntered(newPlayer) local stats = Instance.new("IntValue") stats.Name = "leaderstats" local robux = Instance.new("IntValue") robux.Name = "Credits" robux.Value = 0 robux.Parent = stats stats.Parent = newPlayer end game.Players.ChildAdded:connect(onPlayerEntered)
I don't know if this might help but here.
if plr and plr:FindFirstChild("leaderstats")--Put Brackets between the text plr.leaderstats:FindFirstChild("Credits") then plr.leaderstats.Credits.Value = plr.leaderstats.Credits.Value + script.Parent.Name end
what you can also do is that after they purchase the "50 credits" pass for robux, make them able to go in the vip room that has a botton that u step on for 50 credits, but then it teleports u back and u cant take another one. making a vip only room is very easy and can be found in free models