Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

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

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

✓ Accepted answer

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)

This discussion is preserved as it was. New answers, comments, and votes are closed.