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

Gamepass Walkspeed giver, refusing to work?

Not sure, any help? I'm using the new gamepass call functions..

local MarketplaceService = game:GetService("MarketplaceService")
local Players = game:GetService("Players")
 
local gamePassID = 836664  
 
local function onPlayerAdded(player)
    local hasPass = false
 
    -- Check if the player already owns the game pass
    local success, message = pcall(function()
        hasPass = MarketplaceService:UserOwnsGamePassAsync(player.UserId, gamePassID)
    end)
 
    -- If there's an error, issue a warning and exit the function
    if not success then
        warn("Error while checking if player has pass: " .. tostring(message))
        return
    end
 
    if hasPass == true then
        print(player.Name .. " owns the game pass with ID " .. gamePassID)
		player.Humanoid.WalkSpeed = 30
    end
end

1 answer

✓ Accepted answer

Add this at the end of your code:

game:GetService('Players').PlayerAdded:Connect(onPlayerAdded)

And on your line 22, make player.Humanoid.WalkSpeed = 30 to player.Character.Humanoid.WalkSpeed = 30

2 comments

0

for some wierd reason, while testing it, its still not working? no errors though?

0

disregard, fixed it, thank you

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