[로블록스 스튜디오] 엘레베이터 파트 만들기!

Поделиться
HTML-код
  • Опубликовано: 24 сен 2024
  • 스크립트
    local speed = 50 --올라가는 스피드
    script.Parent.Touched:Connect(function(hit)
    local rootpart = hit.Parent:FindFirstChild("HumanoidRootPart") or hit
    if not rootpart:FindFirstChild("Elevator") and hit.Parent:FindFirstChild("Humanoid") then
    local velocity = Instance.new("BodyVelocity", rootpart)
    velocity.Name = "Elevator"
    local posi = script.Parent.CFrame.UpVector
    local vector = Vector3.new(0,math.huge,0)
    if posi.X ~= 0 then
    vector = Vector3.new(math.huge, vector.Y, vector.Z)
    end
    if posi.Z ~= 0 then
    vector = Vector3.new(vector.X, vector.Y, math.huge)
    end
    velocity.MaxForce = vector
    velocity.Velocity = script.Parent.CFrame.UpVector * speed
    end
    end)
    script.Parent.TouchEnded:Connect(function(hit)
    local rootpart = hit.Parent:FindFirstChild("HumanoidRootPart") or hit
    if rootpart:FindFirstChild("Elevator") and hit.Parent:FindFirstChild("Humanoid") then
    for i, v in pairs(rootpart:GetChildren()) do
    if v.ClassName == "BodyVelocity" then
    v:Destroy()
    end
    end
    end
    end)

Комментарии • 6

  • @DuckIsNovati
    @DuckIsNovati  2 года назад +3

    마지막 자막 : 1.5분쯤에 자막이 가려졌어요~ 내용은 설명창 스크립트 복붙 하라는 이야기입니다.

  • @하랭-n1e
    @하랭-n1e 2 года назад +3

    1빠

  • @A_Love_Song.
    @A_Love_Song. Год назад +2

    3빠

  • @LEE_JI_HO
    @LEE_JI_HO 2 года назад +1

    2빠

  • @jhIh92.s
    @jhIh92.s Год назад +1

    너무 느려요,,

    • @무야키
      @무야키 Год назад +2

      스피드를 올리세요...