로블록스로 배우는 코딩 #9 - 버튼을 눌러 문 열고 닫기 lightStatus = false local light = game.Workspace.Light local hinge = game.Workspace.Door.HingeConstraint function onClicked(playerWhoClicked) hinge.Enabled = true if not lightStatus then light.Color = Color3.fromRGB(255, 255, 0) lightStatus = true hinge.AngularVelocity = -0.5 while hinge.CurrentAngle > -90 do wait(0.1) end else light.Color = Color3.fromRGB(0, 0, 0) lightStatus = false hinge.Angu.. 2022. 10. 6. 로블록스로 배우는 코딩 #8 - 버튼을 눌러 전등 끄고 켜기 lightStatus = false local light = game.Workspace.Light function onClicked(playerWhoClicked) script.Parent.Transparency = 1 if not lightStatus then light.Color = Color3.fromRGB(255, 255, 0) lightStatus = true else light.Color = Color3.fromRGB(0, 0, 0) lightStatus = false end wait(.1) script.Parent.Transparency = 0 end script.Parent.ClickDetector.MouseClick:connect(onClicked) 강릉바다의 블로그 Since 2008... 2022. 10. 6. 로블록스로 배우는 코딩 #7 - 용암을 밟으면 HP가 줄어들어요 local humanoid = script.Parent:FindFirstChild("Humanoid") local deBounce = false function lavaTouch(part) print(humanoid.FloorMaterial) if humanoid.FloorMaterial.Name == "CrackedLava" then if not deBounce then deBounce = true while humanoid.FloorMaterial == Enum.Material.CrackedLava do humanoid:TakeDamage(10) wait(1) end deBounce = false end end end humanoid:GetPropertyChangedSignal("FloorMateri.. 2022. 10. 6. 로블록스로 배우는 코딩 #6 - 용암을 밟으면 HP가 줄어들어요 local player = script.Parent local humanoid = player:FindFirstChild("Humanoid") local deBounce = false function lavaTouch(part) if humanoid.FloorMaterial ~= nil and humanoid.FloorMaterial.Name == "CrackedLava" then if not deBounce then deBounce = true humanoid:TakeDamage(10) wait(1) deBounce = false end end end humanoid.Running:Connect(lavaTouch) 강릉바다의 블로그 Since 2008. 1. https://gnbada.kr/ 2022. 10. 6. 로블록스로 배우는 코딩 #5 - 열렸다 닫히는 문 local model = script.Parent local moveCheck = false function touchEventt(part) local character = part.Parent local humanoid = character:FindFirstChild("Humanoid") local wall = game.Workspace.Wall.Center if humanoid ~= nil and not moveCheck then model.Color = Color3.fromRGB(255, 0, 0) moveCheck = true for cnt = 1, 10, 1 do wall.Position = wall.Position - Vector3.new(0, 0, 1) wait(0.1) end wait(5).. 2022. 10. 6. 로블록스로 배우는 코딩 #4 - 옆으로 열리는 문 local model = script.Parent local moveCheck = false function touchEventt(part) local character = part.Parent local humanoid = character:FindFirstChild("Humanoid") local wall = game.Workspace.Wall.Center if humanoid ~= nil and not moveCheck then model.Color = Color3.fromRGB(255, 0, 0) moveCheck = true for cnt = 1, 10, 1 do wall.Position = wall.Position - Vector3.new(0, 0, 1) wait(0.1) end end end.. 2022. 10. 6. 이전 1 ··· 7 8 9 10 11 다음