How can I make this gamepass work?

You can write your topic however you want, but you need to answer these questions:

  1. What do you want to achieve? a gamepass that multiplies the amount of strength

  2. What is the issue? the script doesn’t multiply the value of Strength. by 2

  3. What solutions have you tried so far? I’m not sure why the script isn’t working, I’ve watched many videos on gamepasses but nothing has helped so far.

After that, you should include more details if you have any. Try to make your topic as descriptive as possible, so that it’s easier for people to help you!

gamepass script:

local id = 19736256


game:GetService("MarketplaceService").PromptGamePassPurchaseFinished:Connect(function(player,ido,purchased)
	if purchased and id == ido then
		player.leaderstats.Strength.Value = player.leaderstats.Strength.Value * 2
	end
end)

game.Players.PlayerAdded:Connect(function(player)
	if game:GetService("MarketplaceService"):UserOwnsGamePassAsync(player.UserId,id) then
		player.leaderstats.Strength.Value = player.leaderstats.Strength.Value * 2
	end
end)

all help is appreciated

1 Like

Are there any errors in the output?

nope, the script does nothing though

The problem is that you are only multiplying the value when they join & when they first buy the game pass. You are not adding a recurring multiplier whenever the value gets changed. Show me the script that changes the value of “strength” whenever a player does something. (weight-lifting, etc…)

here’s the part of the script that controls the strength value. let me know if you need the full thing

local debounce = RemoteData[player.Name].debounce

	if not debounce.Value then 
	
		print("past debounce if statement")
	
		debounce.Value = true
	
		player.leaderstats.Strength.Value = player.leaderstats.Strength.Value + 25 *(player.leaderstats.Rebirths.Value+1)
	
		wait(cooldown)
	
		debounce.Value = false
	
	end

end)
1 Like

Here is what you should do. Instead of multiplying the strength value, create a new value when the player has entered called strength multiplier. This will be useful as well if you want to sell like 5 mins devproducts for strength boosts. Do something like this:

local id = 19736256


game:GetService("MarketplaceService").PromptGamePassPurchaseFinished:Connect(function(player,ido,purchased)
	if purchased and id == ido then
		player.StrengthMultipler.Value = player.StrengthMultipler.Value * 2
	end
end)

game.Players.PlayerAdded:Connect(function(player)
	local strengthmul = Instance.new("IntValue")
	strengthmul.Name = "StrengthMultiplier"
	strengthmul.Parent = player
	strengthmul.Value = 1
	if game:GetService("MarketplaceService"):UserOwnsGamePassAsync(player.UserId,id) then
		strengthmul.Value = strengthmul.Value * 2
	end
end)

Then, You can do this:

local debounce = RemoteData[player.Name].debounce

	if not debounce.Value then 
	
		print("past debounce if statement")
	
		debounce.Value = true
	
		player.leaderstats.Strength.Value = (player.leaderstats.Strength.Value + 25 *(player.leaderstats.Rebirths.Value+1)) *  plr.StrengthMultiplier.Value
	
		wait(cooldown)
	
		debounce.Value = false
	
	end

end)

You can change the way you multiply the strength multiplier if you don’t want it to count for the rebirth too. And make sure in the final statement to correctly reference the player, or change it to whatever the player is in your script.

1 Like

thank you so much for this, I’m going to try it and let you know!

for some reason it’s telling me that the multiplier isn’t a part of the player, but it’s there?

I spelt multiplier wrong lol XD I fixed it, just paste it again

1 Like

Did it work? :slight_smile:

30char

yup! it’s working flawlessly, thanks so much for your help!