I need to know how to get the UserId of a player just by knowing his name.
This question is very simple, thus the answer is also very simple.
local player = game.Players:FindFirstChild(name) -- This will find the player based on the name, so make sure "name" is the name you have. local userId = player.userId -- The id of a user!
Hope this helped :)
If you want to get a player's userId from their username, even when they're not in game, use:
local username = "Builderman" -- Username goes here. local userid = game.Players:GetUserIdFromNameAsync(username) print(userid)