Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Why wont my game pass script give players that have it speed?

Asked by 5 years ago
local devidl = 5615718 
game:GetService("MarketplaceService").PromptGamePassPurchaseFinished:Connect(function(player,gamepassid,ispurchased)
    function player.CharacterAdded:Connect(char)
        if game:GetService("MarketplaceService"):UserOwnsGamePassAsync(player.userId,devidl) == false then
            if ispurchased == false then
                if gamepassid == devidl then
                    char.Humanoid.WalkSpeed = 24
                end
            end
            end
    end
    end)

There are no errors.

0
whats with the double ends? SteamG00B 1633 — 5y
0
There's nothing wrong with that, I'm just saying that its odd SteamG00B 1633 — 5y

1 answer

Log in to vote
0
Answered by
SteamG00B 1633 Moderation Voter
5 years ago
Edited 5 years ago
local devidl = 5615718 
game:GetService("MarketplaceService").PromptGamePassPurchaseFinished:Connect(function(player,gamepassid,ispurchased)
    function player.CharacterAdded:Connect(char)
        if game:GetService("MarketplaceService"):UserOwnsGamePassAsync(player.UserId,devidl) == false then
            if ispurchased == true then--you just set this to the wrong value
                if gamepassid == devidl then
                    char.Humanoid.WalkSpeed = 24
                end
            end
            end
    end
    end)

So you just set the ispurchased to false when it should've been true. Also, you shouldn't check for if a person owns a gamepass within the thing that purchases the gamepass.

Simple capitalization error: userId, should be UserId

0
It's not working - No error messages. jalbraek 29 — 5y
0
found the problem :) (I hope) SteamG00B 1633 — 5y
Ad

Answer this question