Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

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

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.

2 comments

0

whats with the double ends?

0

There's nothing wrong with that, I'm just saying that its odd

1 answer

✓ Accepted answer
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

2 comments

0

It's not working - No error messages.

0

found the problem :) (I hope)

This discussion is preserved as it was. New answers, comments, and votes are closed.