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やってみた。
練習問題やってみた。

練習問題

スクリプトだけで、箱にサウンドエフェクトせよ。

手順

  • ReplicatedFirstに、LocalScriptを追加。
  • スクリプトを書く。

local RunService = game:GetService("RunService")
local part = Instance.new("Part")
part.Position = Vector3.new(-5, 6, -10)
part.Parent = workspace
local sound;
local function createSound(id, volume)
	local sound = Instance.new("Sound")
	sound.SoundId = "rbxassetid://" .. id
	sound.Volume = volume or 5
	sound.Parent = part
	return sound
end
local function updateColor(deltaTime)
	local hue = sound.PlaybackLoudness / 1000
	part.Color = Color3.fromHSV(hue, 1, 1)
end
sound = createSound(3308152153)
sound:Play()
RunService.RenderStepped:Connect(updateColor)



写真

image.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?