Ad
Still have questions? Join our Discord server and get real time help.
Log in to vote
0

Anyone know how to make the dropper give more money when you buy a game pass?

Asked by 12 days ago
Edited 12 days ago

I'm trying to make it so that when you buy a game pass the droppers drop more money. Here is the script in the droppers.

Cash.Value = 00 

Cash.Value is how much each dropper gives.

wait(2)
workspace:WaitForChild("PartStorage")

while true do
    wait(2.5) 
    local part = Instance.new("Part",workspace.PartStorage)
    part.BrickColor=script.Parent.Parent.Parent.DropColor.Value
    part.Material=script.Parent.Parent.Parent.MaterialValue.Value
    local cash = Instance.new("IntValue",part)
    cash.Name = "Cash"
    cash.Value = 20 
    part.CFrame = script.Parent.Drop.CFrame - Vector3.new(0,1.6,0)
    part.FormFactor = "Custom"
    part.Size=Vector3.new(1.4, 1.4, 1.4)
    part.TopSurface = "Smooth"
    part.BottomSurface = "Smooth"
    game.Debris:AddItem(part,20) 
end

2 answers

Log in to vote
1
Answered by
Pupppy44 471 Moderation Voter
12 days ago

You can use UserOwnsGamePassAsync to do this. Here's an example of how it works:

function PlayerAdded(p)
if game:GetService("MarketplaceService"):UserOwnsGamePassAsync(p.UserId, 1234) then -- This would return a bool value, if I own it it would return true, else false
print(p.Name ... " owns the gamepass!") 
else
print(p.Name ... " doesn't own the gamepass")
end
end

game:GetService("Players").PlayerAdded:Connect(PlayerAdded)
Ad
Log in to vote
0
Answered by 12 days ago

Use UserOwnsGamePassAsync.

That might help you!

Answer this question