Hello, I have this script here, which when you touch the part, it is supposed to convert the ingame leaderstats, "Jump" into "Bills" so say you have 10 Jumpand you touch the part, its supposed to turn that Jump into Bills, so now you would have 0 jump and 10 bills. And if you owned a gamepass, then if you had 10 jump, it was supposed to turn it into 20 bills instead of 10. It doesnt work though and i have failed to figure out why. Could ANYBODY please help me with this, it is quite urgent, Thank you merry christmas!
local debounce = true
script.Parent.Touched:Connect(function(partThatTouched)
local humanoid = partThatTouched.Parent:FindFirstChildWhichIsA("Humanoid")
if humanoid then
local player = game.Players:FindFirstChild(partThatTouched.Parent.Name)
local PlrStatsJump = player.leaderstats:FindFirstChild("Jump")
local PlrStatsBills = player.leaderstats:FindFirstChild("Bills")
if debounce then
if game:GetService("MarketplaceService"):UserOwnsGamePassAsync(partThatTouched, 7549267) then
debounce = false
PlrStatsBills.Value = PlrStatsBills.Value + PlrStatsJump.Value * 2
wait()
PlrStatsJump.Value = 0
wait (2)
debounce = true
else
debounce = false
PlrStatsBills.Value = PlrStatsBills.Value + PlrStatsJump.Value
wait()
PlrStatsJump.Value = 0
wait (2)
debounce = true
end
end
end
end)
Things to remeber, **- It is a ServerScript
- The Scripts parent is a Part**

2 comments
It doesnt work, even if I dont own the gamepass, it stil multiplys it
Nvm it worked TYSM