1주차>
* StairSwitch
👦 Stair 폴더 만들기
👦 계단 차례대로 Stair_1, Stair_2 ~ Stair_5 5개 만들고(이름변경) Stair 폴더에 집어넣기
👦 큰 계단 만들기 → 5개 모두 Anchored 체크, CanCollide 해제, Transparency 1 (한번에)
👦 Switch 블록 만들기(블록이름: Switch, script 이름: StairSwitch)
* RGB Color - colorpicker 사이트 참조
local switchStair = script.Parent
local onColor = Color3.fromRGB(①) -- 계단이 생기면 나타나는 색깔
local offColor = Color3.fromRGB(②) -- 계단이 사라지면 나타나는 색깔
local stairColor = Color3.fromRGB(③) -- 계단색깔
switchStair.Color = ④
local stair1 = game.Workspace.Stair.Stair_1
local stair2 = game.Workspace.Stair.Stair_2
local stair3 = game.Workspace.Stair.Stair_3
local stair4 = game.Workspace.Stair.Stair_4
local stair5 = game.Workspace.Stair.Stair_5
local stairArray = ⑤
local function showStair()
for i = 1, ⑥ do
switchStair.Color = ⑦
stairArray⑧.Color = stairColor
stairArray⑧.CanCollide = ⑨
stairArray⑧.Transparency = 0
wait(1)
end
wait(1)
for i = ⑥, 1, ⑩ do
stairArray⑧.CanCollide = ⓐ
stairArray⑧.Transparency = 1
wait(1)
end
switchStair.Color = ⓑ
end
switchStair.Touched:Connect(showStair)
* 도전과제>
👦 if문을 이용해 계단별 색깔을 다르게 해보기
👦 계단이 생길때 색깔이 빛나게 Material 종류를 바꿔보기
'Roblox Game Creator' 카테고리의 다른 글
로블록스_심화_3주차 (NPC 1/2) (0) | 2022.12.15 |
---|---|
로블록스_심화_2주차(Animation) (0) | 2022.12.07 |
로블록스_기초_8주차(HealingWater) (0) | 2022.10.27 |
로블록스_기초_7주차 (MovingWalk, RotationBlock) (0) | 2022.10.20 |
로블록스_기초_6주차 (KillBlock, FirePad) (0) | 2022.10.13 |
댓글