How do I access the player's character with the player's UserId?

So I was just wondering how could I access the player’s character (from a server script) using their UserId ?

Thanks!

local Players = game:GetService("Players")

local Player = Players:GetPlayerByUserId(userid_here)
Player.Character.Humanoid.WalkSpeed = 50 --sets their walkspeed to 50

1 Like