Trouble making 2x Speed Gamepass

Im trying to set up a 2x speed gamepass that essentially gives you 2x the points in the leaderstat & also makes you go 2x as fast as other players that dont have the pass, ive tried basically everything but its clear im missing a big piece of the script or something, can someone help me out? But it is not showing that it is giving me 2x in the leaderstat nor is it doing it in game

local Players = game:GetService("Players")
local MPS = game:GetService("MarketplaceService")

Players.PlayerAdded:Connect(function(Plr)
	Plr.CharacterAdded:Connect(function(char)
		
		local Humanoid = char:FindFirstChild("Humanoid")
		if MPS:UserOwnsGamePassAsync(Plr.UserId, 2989290492) then  
			Humanoid.WalkSpeed = game.StarterPlayer.CharacterWalkSpeed * 2
		end
	end)
end)


1 Like

Try this:

local Players = game:GetService("Players")
local MPS = game:GetService("MarketplaceService")

Players.PlayerAdded:Connect(function(Plr)
	Plr.CharacterAdded:Connect(function(char)
		
		local Humanoid = char:FindFirstChild("Humanoid")
		if MPS:UserOwnsGamePassAsync(Plr.UserId, 2989290492) then  
			Humanoid.WalkSpeed = game:GetService("StarterPlayer").CharacterWalkSpeed.Value * 2
		end
	end)
end)

Still nothing, which is weird. I just dont understand

Can you show output?

Is there a way to do it for a specific script?

You can type script name in search bar in output.

Try this instead:

Humanoid.WalkSpeed = Humanoid.WalkSpeed * 2
1 Like

Try Reset Character after you bought the gamepass, maybe this is the problem.

There is no outputs for the certain script, so what now.

1 Like

Nope, this wasnt it. Smart thought but it wasnt it


For some reason, your gamepass is not in Roblox, maybe you created a Developer Product, not a gamepass, or entered the wrong Id?

1 Like

Its cause its offsale currently, which may be why-

The game pass does not exist as stated. Off sale does not correlate to the situation of it not being accessible through page. You probably mistake it for a developer product.

It was the wrong gamepass id, gamepass id is 646849162. But it still refuses to work

The CharacterAdded function is not consistent. Use CharacterAppearanceLoaded, or put a wait(2) at the beginning of the CharacterAdded function.

1 Like

Are you trying to do this with a LocalScript? I tried this with a server script and it worked. If you were doing a LocalScript change it to a Server Script and place it in ServerScriptService.

Is this a local script or a serverscript?

Its a serverscript, I never mess around with localscripts really. It might just be conflicting with my leaderstat script

Try this:

local Players = game:GetService("Players")
local MPS = game:GetService("MarketplaceService")

Players.PlayerAdded:Connect(function(Plr)
	Plr.CharacterAdded:Connect(function(char)
		local Humanoid = char:FindFirstChildOfClass("Humanoid")
		
		if MPS:UserOwnsGamePassAsync(Plr.UserId, YOURIDHERE) then  
			Humanoid.WalkSpeed = Humanoid.WalkSpeed * 2
		end
	end)
end)

Still didnt work, must be a conflicting problem with my leaderstats