I had an idea to make a useless pass into somegamepass that gives you 2 times cash,
for example, I win and get 10 cash, if I own this pass i get 20 cash, But how would I do that?
Thanks!
You could use the marketplace service to check if they have the gamepass, here is how you would have it:
local ms = game:GetService("MarketplaceService")
local haspass = ms:UserOwnsGamePassAsync(userid, gamepassid)
userid can be gotten using Player.Userid
and insert your double cash gamepass for gamepassid
Then to multiply the reward by two you could do
if haspass then
reward *= 2
end
4 Likes
wait im confused, where and how would i insert this?
this is the script that gives a team cash
local Amount = 10
local DesiredTeam = Teams:FindFirstChild("White Team")
for _,child in pairs(DesiredTeam:GetPlayers()) do
child.leaderstats.Cash.Value += Amount
end
amount is basically reward.
1 Like
Define marketplace service at the top of your script:
local ms = game:GetService("MarketplaceService")
This is how you would add it to what your code
local DesiredTeam = Teams:FindFirstChild("White Team")
for _, player in pairs(DesiredTeam:GetPlayers()) do
local reward = 10
local haspass = ms:UserOwnsGamePassAsync(player.UserId, 0) --make sure to change the gamepass id to your gamepass
if haspass then
reward *= 2
end
child.leaderstats.Cash.Value += Amount
end
2 Likes
IT WORKED!!!
thanks for your help!