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

How would I add more to this for more badges and gamepasses, help?

I'm trying to add in multiple gamepasses and badges for cash giving on my tycoon, I have several problems with this script but It seems to work.

Problem 1: Doesn't work most of the time, and sometimes it does.

Problem 2: I'd like to be able to hold all my gamepass and badge scripts in this single script.

Script

game.Players.PlayerAdded:connect(function(plr)
	local cashmoney = game.ServerStorage.PlayerMoney:FindFirstChild(plr.Name)
	if game:GetService("MarketplaceService"):PlayerOwnsAsset(plr,852280622) then
		print(plr.Name .. " owns the Badge")
		if cashmoney then
			cashmoney.Value = cashmoney.Value + 100000
		end
	else
		print(plr.Name .. " doesn't own Badge")
	end
end)

Thanks for your time!

-Species

1 answer

if 1 == 1 then -- checking statement
	print("player has gamepass")
elseif 1 == 2 then -- checking statement
	print("player has gamepass 2")
elseif 1 == 3 then -- can use as many elseifs as wanted.
	print("player has gamepass 3")
end

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