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

I'm a beginner scripter so I would like some help with this, can someone help?

I'm a beginner scripter so I wouldn't be surprised if there are multiple bugs with this.

I had multiple scripts changing the players money, and I only wanted one so this is my solution.

But now the badges don't give money anymore, they hardly worked in the first place, occasionally working but most of the time not working.

If someone could help me out that'd be great!

Thanks for your time

-Species

game.Players.PlayerAdded:connect(function(player)
	local cashmoney = game.ServerStorage.PlayerMoney:FindFirstChild(player.Name)
	local marketplaceservice = game:GetService("MarketplaceService")	
	
	
	if marketplaceservice:PlayerOwnsAsset(player,540679791) then
		wait(1)
		print(player.Name .. " owns the VIP")
		if cashmoney then
			cashmoney.Value = cashmoney.Value + 10000
		end
	
	elseif marketplaceservice:PlayerOwnsAsset(player,852280707) then
		wait(1)
		print(player.Name .. " owns the Badge")
		if cashmoney then
			cashmoney.Value = cashmoney.Value + 10000			
		end
	
	elseif marketplaceservice:PlayerOwnsAsset(player,530169400) then
		wait(1)
		print(player.Name .. " owns the Badge")
		if cashmoney then
			cashmoney.Value = cashmoney.Value + 10000	
		end
		
	elseif marketplaceservice:PlayerOwnsAsset(player,530169267) then
		wait(1)
		print(player.Name .. " owns the Badge")
		if cashmoney then
			cashmoney.Value = cashmoney.Value + 55000
		end
		
	elseif marketplaceservice:PlayerOwnsAsset(player,852280622) then
		wait(1)
		print(player.Name .. " owns the Badge")
		if cashmoney then
			cashmoney.Value = cashmoney.Value + 100000
		end		
	end
end)

1 comment

0

repeat wait() until cashmoney ~= nil

1 answer

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