So I’m not sure why, because the print lines print("hi") and print("success!") show up, but it doesn’t want to set the value.
Script:
local MarketPlace = game:GetService("MarketplaceService")
local ID = 6645699
game.Players.PlayerAdded:Connect(function(player)
local hasPass = false
local success, message = pcall(function()
hasPass = MarketPlace:UserOwnsGamePassAsync(player.UserId, ID)
end)
if not success then
error("Error! "..tostring(message))
end
if hasPass == true then
print("hi")
player:WaitForChild("Gamepasses").OwnsPowerPack.Value = true
print("success!")
else
print(player.Name.." doesn't own Power Pack.")
end
end)
Thanks! ![]()