Robloxでスクリプトを使用してユーザー名を取得する
ユーザーネーム(Name)の取得方法
NameはPlayerオブジェクトのプロパティとして存在するため、Playerを取得し表示する
- ServerScriptService配下にスクリプトを作成、名前をGetUserNameにする

2. .スクリプトを以下のように編集する
-- UserNameを出力する local function printUserName(player) print(player.Name) end -- プレイヤーが登録されたときにprintUserNameをよびだす game.Players.PlayerAdded:Connect(printUserName)
実行結果
