본문 바로가기
Programming/Roblox

로블록스로 배우는 코딩 #11 - 캐릭터에 효과(불, 연기, 스파클) 적용

by 강릉바다의 블로그 2022. 10. 6.

local me = script.Parent
local audio = script.Parent.Laser

local function PassGate(part)
	local character = part.parent
	local humanoid = character:FindFirstChild("Humanoid")

	if humanoid ~= nil and me.Transparency ~= 1 then
		print(part.name)
		me.Transparency = 1
		me.CanCollide = false
		local fire = Instance.new("Fire")
		fire.Parent = humanoid.Parent.UpperTorso
		fire.Heat = 10
		fire.Size = 10		
		audio.Looped = false
		audio.Playing = true
		wait(0.1)
	end
end

me.Touched:Connect(PassGate)

local me = script.Parent
local audio = script.Parent.Laser

local function PassGate(part)
	local character = part.parent
	local humanoid = character:FindFirstChild("Humanoid")

	if humanoid ~= nil and me.Transparency ~= 1 then
		print(part.name)
		me.Transparency = 1
		me.CanCollide = false
		local smoke = Instance.new("Smoke")
		smoke.Parent = humanoid.Parent.UpperTorso
		smoke.Color = Color3.fromRGB(255, 255, 0)
		smoke.Size = 5		
		audio.Looped = false
		audio.Playing = true
		wait(0.1)
	end
end

me.Touched:Connect(PassGate)

local me = script.Parent
local audio = script.Parent.Laser

local function PassGate(part)
	local character = part.parent
	local humanoid = character:FindFirstChild("Humanoid")

	if humanoid ~= nil and me.Transparency ~= 1 then
		print(part.name)
		me.Transparency = 1
		me.CanCollide = false
		local particleemitter = Instance.new("ParticleEmitter")
		particleemitter.Parent = humanoid.Parent.UpperTorso
		particleemitter.Rate = 20		
		audio.Looped = false
		audio.Playing = true
		wait(0.1)
	end
end

me.Touched:Connect(PassGate)


강릉바다의 블로그

Since 2008. 1.

https://gnbada.kr/