this is my code and it will work in testing in the studio but not in real servers

local id = 5136477

game:GetService("MarketplaceService").PromptGamePassPurchaseFinished:Connect(function(plr,ido,purchased)
	if purchased and ido == id then
		plr.Character.Humanoid.WalkSpeed = 50
	end
end)

game.Players.PlayerAdded:Connect(function(plr)
	plr.CharacterAdded:connect(function(char)
		if game:GetService("MarketplaceService"):UserOwnsGamePassAsync(game.Players[char.Name].UserId, id) then
			char.Humanoid.WalkSpeed = 50
		end
	end)
end)

7 comments

0

Can anyone help me?

1

Do you own the gamepass? Or did you make yourself an exception to owning the gamepass?

0

I made and own it

0

It didn't work

0

is char.id even a thing?

0

Yep I just got it working :) I needed to move the script from ServerScript Service to Workspace

0

That couldn't be the reason; even then, that just allows an exploiter to see the script.