Here's the script I have:
local gold = script.Parent.Config.Gold.Value
local exp = script.Parent.Config.XP.Value
local Humanoid = script.Parent.Humanoid
local id = 889632521
game.Players.PlayerAdded:connect(function(player)
if game:GetService("GamePassService"):PlayerHasPass(player, id) == true then
exp.Value = exp.value*2
gold.Value = gold.value*2
end
function PwntX_X()
local tag = Humanoid:findFirstChild("creator")
if tag ~= nil then
if tag.Value ~= nil then
local Leaderstats = tag.Value:findFirstChild("leaderstats")
if Leaderstats ~= nil then
Leaderstats.Gold.Value = Leaderstats.Gold.Value + gold
wait(0.1)
script:remove()
end
end
end
end
Humanoid.Died:connect(PwntX_X)
local Humanoid = script.Parent.Humanoid
function PwntX_X()
local tag = Humanoid:findFirstChild("creator")
if tag ~= nil then
if tag.Value ~= nil then
local Leaderstats = tag.Value:findFirstChild("leaderstats")
if Leaderstats ~= nil then
Leaderstats.XP.Value = Leaderstats.XP.Value + exp
wait(0.1)
script:remove()
end
end
end
end
end)
Humanoid.Died:connect(PwntX_X)

2 comments
Perhaps "PwntX_X" isn't the most informative function name...
Use MarketPlaceService instead, the gamepass service may be deprecated.