local mps = game:GetService("MarketplaceService")
local id = 19083281
game.Players.PlayerAdded:Connect(function(plr)
plr.CharacterAdded:Connect(function(chr)
local fol = Instance.new("Folder", plr)
fol.Name = "Player"
local int = Instance.new("IntValue", fol)
int.Name = "Sprintspeed"
if mps:UserOwnsGamePassAsync(plr.UserId, id) then
int.Value = 100
else
int.Value = 50
end
end)
end)
I have this script to check if a player owns a gamepass, if so change a value to 100 instead of 50. But it always is 50 even when they have the gamepass. What’s wrong with it?
So the code definitely works, maybe it is working but just wasn’t reflected? Put another print statement under the else condition and see if it is actually setting it to 50 or not. If only the print statement for the if condition fires and not for the else condition, it means it’s working as intended.