How do I get the owner name of a game?

The title is the question

2 Likes
local ownerID = game.CreatorId
local ownerName = game.Players:GetNameFromUserIdAsync(ownerID)

print(ownerName)
game.Players.PlayerAdded:Connect(function(Player)
	if game.Players:GetNameFromUserIdAsync(game.CreatorId) == Player.Name then
		print("Success")
	end
end)
game.Players.PlayerAdded:Connect(function(Player)
	print(game.Players:GetNameFromUserIdAsync(game.CreatorId))
end)

Make sure you’ve published the game

3 Likes