I’d like to make a request thingy in my roblox game, which has to be able to check from any game if the player I specify is owner from a game.
For example, I join my hub, and enter the game id or place id from Jailbreak. I press “check”, and it will say “You’re not the owner”. If the actual owner would join, it’d say “you are the owner”.
I’m not asking for a whole script, I’m just asking how I’d get that specific part to check if a user is the owner from a game / place.
I think what he’s trying to accomplish is if a player is an owner of any game ID he puts in. So if he puts in his game ID, he would be recognized as the owner. If he put in Jailbreak’s, he won’t be recognized, but asimo3089/badccvoid would.
The only caveat with this is you enter a user’s ID and get their games, not the other way around (you mentioned this). The only way this could work is if, when you enter a PlaceID, it cycles through every player and group until it finds someone owning it (which would not be feasible).
This is probably the best way to do it as taken directly (with a few modifications) from a few lines of script from ModelMakerLua’s admin commands:
local PlaceId = 0 --Just put the ID here
local PlaceInfo = game:GetService("MarketplaceService"):GetProductInfo(PlaceId)
if PlaceInfo.Creator.CreatorType == "Group" then --Owner if the place is in a group
GameOwner = game:GetService("GroupService"):GetGroupInfoAsync(PlaceInfo.Creator.CreatorTargetId).Owner.Name
elseif PlaceInfo.Creator.CreatorType == "User" then --Owner if it was published to their profile
GameOwner = PlaceInfo.Creator.Name
end
print(GameOwner)
-- If you check the ID of the owner instead of their name, also use this.
if IdOfOwner == game.Players:GetUserIdFromNameAsync(GameOwner) then
print("It's ze owner!")
end
Using it in a manner like that is definetly not feasible, what you would instead do is get all the possible games a user and their groups own and cache the results from there. MarketplaceService:GetProductInfo() is definetly what he was looking for, however caching results would only require a few requests at most.