채팅0

    조용히

    조회수 489

    --몬스터 캐릭터 옆으로 불러오기

    local characterX = target.TransformComponent.WorldPosition.x
    mob.TransformComponent:SetWorldPosition(Vector3(characterX + 1, mob.TransformComponent.WorldPosition.y, mob.TransformComponent.WorldPosition.z))
    
    if (isvalid(target) and ai.LocalUnchaseTick < 7) then
        if (ai.AttackWasLast) then
            nextAction = _GlobalRand32:RandomIntegerRange(200, 900) / 1000
        else
            nextAction = _GlobalRand32:RandomIntegerRange(100, 160) / 1000
        end
    
        local targetX = target.TransformComponent.WorldPosition.x + 0.5
        newInputX = targetX > mobX and 1 or -1
    else
        nextAction = (_GlobalRand32:RandomIntegerRange(100, 300) / 1000)
        newInputX = _GlobalRand32:RandomIntegerRange(-1, 1)
    end
    
    local platforms = mob.CurrentMap.PlatformInfoComponent
    local timelines = {}
    local timelineIndex = 0
    
    local lastTimeline = 0
    local playerFh = _UserService.LocalPlayer.WsUserController.LastFoothold
    if (playerFh == 0 or platforms.ZMass[playerFh] ~= ai.LocalStartChaseZMass) then
        -- ai.LocalUnchaseTick += 1
        -- ai:IncUnTick()
        local rb = mob.MobRigidbodyComponent
    end
    
    local function makeCommand(cmd, value, timeline, nextActionTime)
        timelines[timelineIndex + 1] = {cmd, value, timeline - lastTimeline, nextActionTime}
        timelineIndex = timelineIndex + 1
        lastTimeline = timeline
    end
    
    makeCommand(_MobActionPartType.Move, newInputX, 0, nextAction)
    ai.NextRandomJump = math.max(ai.NextRandomJump, now + 1)
    
    kb:SetShoeAttr(0)
    
    if (timelineIndex > 0) then
        mob.CurrentMap.LifeControllerComponent:RequestControl(mob, timelines, timelineIndex, false)
    end
    
    ai:EnableNextControlTimer(nextAction)

    댓글2

    회원프로필

    형 진짜 뭐가 뭔지 몰라요 스크립트 시원하게 한번 올려주세여

    2024.01.27 23:33
    회원프로필

    메모장만 2시간봣어요 ㅠ

    2024.01.27 23:33

      게시글 리스트
      제목작성자작성일조회
      공지10-2022387
      6179303:20152
      6179212-28428
      6179112-28476
      6179012-26715
      6178912-25861
      6178812-25804
      6178712-241093
      6178612-231449
      6178512-221445
      6178412-221597
      6178312-221404
      6178212-211471
      6178112-211644
      6178012-211560
      6177912-191751
      6177812-181842
      6177712-182480
      6177612-162359
      6177512-142448
      안내 배너 이미지