I have seen a game that kicks you if you do not have a verified email. I find that very anomalous as I don’t believe there is a proper way to check if you have a verified email or not, how would I add a system like that to my game? I have searched and not found anything, I assume it may be something to do with the verified hat Roblox gives you, but then how would that work with hidden inventories?
2 Likes
To my knowledge, there is no official way to confirm whether a user has a phone number or email linked to their account.
However, this can still be checked by looking for the Verified, Bonafide, Plaidafied, an item awarded to a user when they link a phone number or email to their Roblox account, in a user’s inventory.
local MarketplaceService = game:GetService("MarketplaceService")
local Players = game:GetService("Players")
local HatId = 102611803
Players.PlayerAdded:Connect(function(Player)
local Success, Result = pcall(function()
return MarketplaceService:PlayerOwnsAsset(Player, HatId)
end)
if not Success or not Result then
Player:Kick("You must have an email or phone number linked with your Roblox account to play this game!")
end
end)
13 Likes
Hi! Does this work if the player’s inventory is private?
1 Like
I’ve checked by creating a game, having a fresh account with a private inventory join the game, verifying an email with the account, then rejoining the game to see if it detected the item. Before verifying the email, I was kicked from the game immediately. After linked an email, I was allowed into the game.
TLDR; Yes
4 Likes
local players = game:GetService"Players"
local marketplace = game:GetService"MarketplaceService"
local playerOwnsAsset = marketplace.PlayerOwnsAsset
local assetIds = {18824203, 1567446, 93078560, 102611803}
local function onPlayerAdded(player)
for _, assetId in ipairs(assetIds) do
local success, result = pcall(playerOwnsAsset, marketplace, player, assetId)
if success then
if result then
return
end
else
warn(result)
end
end
player:Kick"You are unverified!"
end
players.PlayerAdded:Connect(onPlayerAdded)
11 Likes