local player = game:GetService("Players"):GetPlayerByUserId(game.CreatorId)
if game:GetService("MarketplaceService"):PlayerOwnsAsset(player,2245377877) then
end
I have this but I just get an error about the player
local player = game:GetService("Players"):GetPlayerByUserId(game.CreatorId)
if game:GetService("MarketplaceService"):PlayerOwnsAsset(player,2245377877) then
end
I have this but I just get an error about the player
This discussion is preserved as it was. New answers, comments, and votes are closed.
1 comment
Probably why it errors is because GetPlayerByUserId will try to find the player with the corresponding userId in the server. If the player is not in the game, the function will return nil. You're gonna have to use GetUserIdFromNameAsync and a proxy to access the Roblox API for a website that'll solve this problem