0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

robloxでassistant その206

Posted at

概要

robloxでassistant、やってみた。
copilotに聞いてみた。

robloxでC:\Users\User\AppData\Local\Roblox\Pluginsにscript.luaを置いても動作するのは、なぜ

回答

それは興味深いポイントですね!Roblox Studioでは、特定のフォルダに配置されたプラグインやスクリプトが自動的に読み込まれる仕組みがあります。以下の理由で、C:\Users\User\AppData\Local\Roblox\Plugins\script.lua が動作する可能性があります:


🔧 Roblox Studioのプラグイン読み込みの仕組み

  • Pluginsフォルダの役割
    AppData\Local\Roblox\Plugins フォルダは、Roblox Studioが起動時にプラグインを読み込むための場所です。ここに .rbxm.rbxmx 形式のプラグインファイルがあると、Studioがそれを認識して読み込みます。

  • script.luaが動作する理由
    通常 .lua ファイル単体ではプラグインとして認識されませんが、以下のようなケースでは動作することがあります:

    • 他のプラグインファイル(例:Main.rbxm)が .lua を内部で参照している
    • .lua ファイルがローカル環境で読み込まれるようなカスタムプラグインローダーを使っている
    • Roblox Studioのベータ機能や開発者向け設定で、外部Luaファイルの読み込みが許可されている

🧪 試してみるとわかること

もし script.lua 単体で動作しているように見えるなら、以下を確認してみると面白いかも:

  • 他に .rbxm.rbxmx ファイルが同じフォルダにあるか?
  • script.lua の中身に plugin オブジェクトを使ったコードがあるか?
  • Studioの「プラグイン」タブにそのスクリプトが表示されているか?

💡補足:正しいプラグインの作り方

Roblox Studioで正式にプラグインを作るには、以下の手順が一般的です:

  1. Studio内でプラグイン用のScriptを作成
  2. plugin APIを使って機能を記述
  3. モデルとして保存し、.rbxm 形式でエクスポート
  4. Plugins フォルダに配置

もしその script.lua が何か特別な動作をしているなら、コードを見せてくれたらもっと詳しく分析できるよ。興味ある?

以上。

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?