GetUserIdFromNameAsync

This function returns the players userId from the given username.

Example Usage:

-- 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)

Parameters

player: Player

The specified player object.

debugging: bool

Sends an output log to your output window and developer console.

References

Last updated