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

Players who own gamepass won't get double rewards?

When a player owns this game pass they should receive double rewards if they won the game, and a normal reward if they don't own the game pass. This part of the script is located in the main script. Ask for anymore information!

  • Script type: script
  • Filtering Enabled: Yes
  • API services: Yes
  • Do I own the gamepass: Yes

Btw the variable reward is 25

local reward = 25

  game.Players.PlayerAdded:Connect(function(plr)
		if game:GetService("MarketplaceService"):UserOwnsGamePassAsync(plr.UserId, 6033886) then
		   wait(0.5)
		   plrs[1].leaderstats.Bucks.Value = plrs[1].leaderstats.Bucks.Value + reward*2
        else  
	       plrs[1].leaderstats.Bucks.Value = plrs[1].leaderstats.Bucks.Value + reward  
       end 
   end)

8 comments

0

and if i understand its not working?

0

How are you detecting that the player has won?

0

The leaderstats are in the script

0

I see how many players are left in the table

0

if #plrs == 1 then......

0

@sbob12345m He's just getting the first player in a table, he's not checking if there is only one person in the game.

0

Is this an error with this script?

0

There are no output errors.

1 answer

You need to make a remote event then for now on when you are adding stuff you can connect that remote event to the leaderstat script.

1 comment

0

That is not true,

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