Doesnt Sell x2 When Player Has Game Pass?
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:
03 | script.Parent.Touched:Connect( function (partThatTouched) |
04 | local humanoid = partThatTouched.Parent:FindFirstChildWhichIsA( "Humanoid" ) |
06 | local player = game.Players:FindFirstChild(partThatTouched.Parent.Name) |
07 | local PlrStatsJump = player.leaderstats:FindFirstChild( "Jump" ) |
08 | local PlrStatsBills = player.leaderstats:FindFirstChild( "Bills" ) |
11 | local plr = game.Players.LocalPlayer |
12 | if game:GetService( "MarketplaceService" ):UserOwnsGamePassAsync(plr, id) then |
14 | PlrStatsBills.Value = PlrStatsBills.Value + PlrStatsJump.Value + PlrStatsJump.Value |
16 | PlrStatsJump.Value = 0 |
21 | PlrStatsBills.Value = PlrStatsBills.Value + PlrStatsJump.Value |
23 | PlrStatsJump.Value = 0 |