본문 바로가기
Programming/Roblox

로블록스로 배우는 코딩 #10 - 캐릭터 속성(속도, 높이, 크기 등) 제어

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

local me = script.Parent

while me.Transparency ~= 1 do
	local RandomNumber = math.random(8000, 9000) / 10000
	me.Transparency = RandomNumber
	wait(0.1)
end

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 humanoid.WalkSpeed ~= 50 then
		me.Transparency = 1
		me.CanCollide = false
		humanoid.WalkSpeed = 50
		--audio:Play()
		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 humanoid.JumpPower ~= 100 then
		me.Transparency = 1
		me.CanCollide = false
		humanoid.UseJumpPower = true
		humanoid.JumpPower = 100
		--audio:Play()
		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 humanoid.HeadScale.Value ~= 5 then
		me.Transparency = 1
		me.CanCollide = false
		humanoid.HeadScale.Value = 5
		--audio:Play()
		audio.Looped = false
		audio.Playing = true
		wait(0.1)	
	end
end

me.Touched:Connect(PassGate)


강릉바다의 블로그

Since 2008. 1.

https://gnbada.kr/