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

1 comment

0

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