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?

More than 1 year has passed since last update.

アクセルキャンプ復習動画5-9 Roblox Lua ブーブークッションを作ろう

Posted at

みなさんこんにちは

今回はrobloxでブーブークッションを作っていきます。多少お下品な音がするかもしれません。

まず、先にゲームを作ります。

ブーブークッションとなるブロックを先に用意しておき、robloxに保存しておきます。

次に、おならの音を用意します。このあたりのサイトでお気に入りのおならの音(?)をダウンロードしておきます。

そしたらroblox creators hubというサイトを見てみましょう。「ダッシュボード」「開発用アイテム」「オーディオ」と進み、先ほどのおなら音をアップロードします。

点三つのところをクリックし「アセットのIDをコピー」をクリックします

roblox studio に戻りましょう。

このような形で ブロックの下にsoundとscriptを置きます。
im.png

スクリプトはこんな感じ。ブロックに触った時のイベント処理で、script.Parent.Sound~ の部分で音を鳴らしています。

script.Parent.Touched:connect(function(hit)
	if hit.Parent:FindFirstChild('Humanoid')then
		script.Parent.Sound.Playing=true
	end
end)

soundのプロパティのsoundIDに、先ほどのアセットIDをペーストすれば完成
im3.png

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?