0
1

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 5 years have passed since last update.

Robloxで物を点滅させる

0
Last updated at Posted at 2019-11-15

Robloxで爆弾をつくるの続き

概要

  • 爆弾が出たり消えたりします
  • 消えたる爆弾にさわっても爆発します
  • 地雷記憶ゲームで作れそうですね

image.png
image.png
image.png

プログラミング

  • 以前つくったBombScriptに少し追記するだけでOK
  • Transparencyが1なら透明、0ならふつうにみえる、0.5なら半透明
BombScript.lua
local function explosion(hit)
  local touchObject = hit.Parent
  local humanoid = touchObject:FindFirstChildWhichIsA("Humanoid")
  if humanoid then		
	local exp = Instance.new('Explosion')
		exp.Position = hit.Position
		exp.Parent = workspace
	end
end

Workspace.Bomb.Touched:connect(explosion)

-- ここからが新しく追加したところ
-- ずっとくりかえす
while 1 do
	wait(2)
	-- WorkspaceにあるBombの透明度を1にする、つまり透明になる
	game.Workspace["Bomb"].Transparency = 1
	wait(2)
	game.Workspace["Bomb"].Transparency = 0
end

元記事

https://www.youtube.com/watch?v=_K7stCkqFBY

0
1
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
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?