Me and my friend are working on a game about collecting deaths When you die your leaderstat goes up We want it so when you buy a gamepass it multiplys ur deaths by 2 Here is our leaderstats code
game.Players.PlayerAdded:connect(function(player) player.CharacterAdded:connect(function(char) char.Humanoid.Died:connect(function() player.leaderstats.Deaths.Value = player.leaderstats.Deaths.Value +1 end) end) end)
Please help! Thanks Cameron
Hello, Cameron. I wish you luck with your new game!
This script will basically just add the normal +1 which you already have and then if a player has the gamepass he will get an extra +1 to keep it simple!
local MPS = game:GetService("MarketplaceService") local YourGamepassID = 0000000 game.Players.PlayerAdded:connect(function(player) player.CharacterAdded:connect(function(char) char.Humanoid.Died:connect(function() player.leaderstats.Deaths.Value = player.leaderstats.Deaths.Value +1 if MPS:UserOwnsGamePassAsync(player.UserId, YourGamepassID) then player.leaderstats.Deaths.Value = player.leaderstats.Deaths.Value + 1 end end) end) end)