So I spent a while writing this script and it hasnt worked. I have a gamepass and a sell block, when you touch the block, I want the currency "Jump" to be converted into "Bills", (say you have 50 Jump, and you touch the block, you will then have 0 Jump and 50 Bills) and if the player has a gamepass then I want them to get 2x the origanl amount, e.g if the player doesnt not have the gamepass then they will get 50 Bills, and if they do have the gamepass, then they will get 100 Bills. Thank you! (Please help I spent ages on the script) ????
Script:
local debounce = true
script.Parent.Touched:Connect(function(partThatTouched)
local humanoid = partThatTouched.Parent:FindFirstChildWhichIsA("Humanoid") --Humanoid
if humanoid then
local player = game.Players:FindFirstChild(partThatTouched.Parent.Name) --Finds player
local PlrStatsJump = player.leaderstats:FindFirstChild("Jump")
local PlrStatsBills = player.leaderstats:FindFirstChild("Bills")
if debounce then
local id = 7549267
local plr = game.Players.LocalPlayer
if game:GetService("MarketplaceService"):UserOwnsGamePassAsync(plr, id) then
debounce = false
PlrStatsBills.Value = PlrStatsBills.Value + PlrStatsJump.Value + PlrStatsJump.Value
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)

4 comments
Are you sure you own the gamepass?
if you'd scroll down just a little bit you would realise that this question is already answered
Yeah but that wasn't really an answe was it? Do you still want help or no? Im not looking for reputation points
It says the question is answered with the check on the right, no i dont need any more help.