-- Getting ReplicatedStorage and Players service
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local Players = game:GetService("Players")
-- Referencing Essentials
local Essentials = require(ReplicatedStorage.Essentials)
-- On the player added event, we created a function that gets the userId of the player when they join the experience
Players.PlayerAdded:Connect(function(player: Player)
Essentials.GetUserIdFromNameAsync(player, true)
end)
Success:
Essentials: The userId of Femtrs is 189051237
Failed:
Essentials: Failed to retrieve userId from the assigned username
Parameters
player:
The specified player object.
debugging:
Sends an output log to your output window and developer console.