return function (self, mob)
if zz_y7.use_momo then
local ai = mob.MobAIComponent
local kb = mob.MobKnockbackComponent
local rb = mob.MobRigidbodyComponent
if (not isvalid(rb) or not isvalid(kb) or not isvalid(ai)) then
local hasAI = ai ~= nil and 1 or 0
localocal hasKnockback = kb ~= nil and 1 or 0
local hasRigid = rb ~= nil and 1 or 0
log_warning(
log_warning(str
lostring.format("hasAI: %d hasKnockback: %d hasRigid: %d", hasAI, hasKnockback, hasRigid))
returreturn
end
local target = _UserService.LocalPlayer
local nextAction = 0
local timelines = {}
local timelineIndex = 0
loclocal currentX, currentY = mob.TransformComponent.WorldPosition.x, mob.TransformComponent.WorldPosition.y
localocal function makeCommand(cmd, destX, destY, floating, layer)
local duration = math.sqrt((destX - currentX)^2 + (destY - currentY)^2) / (rb.FlySpeed * _Physics.FlySpeed / 1)
currentX = destX
currentY = destY
timelines[timelineIndex +
currentX = destX
currentY = destY
timelines[timeli
currentX = destX
currentY = destY
currentX = destX
currentY = destY
currentX = destX
currentY = d
currentX = destX
current1] = { cmd, { destX, destY, duration, floating, layer }, duration }
timelineIndex = timelineIndex +
tim
1
return duration
end
kb:SetShoeAttr( if (isvalid(target)) then
local targetPos = target.TransformComponent.WorldPosition:ToVector2()
local targetX = targetPos.x
local targetY = targetPos.y
local dirVecX, dirVecY = targetX - mob.TransformComponent.WorldPosition.x, targetY - mob.TransformComponent.WorldPosition.y
dirVecX = dirVecX *
dirVecX = dirVecX 1 -- 조절 가능한 값
dirVecY = dirVecY * 1 -- 조절 가능한 값
targetX = mob.TransformComponent.WorldPosition.x + dirVecX
targetY = mob.TransformComponent.WorldPosition.y + dirVecY
makeCommand(_MobActionPartType.Fly, targetX, targetY,
targetX = mob.TransformComponent.WorldPosition.x + dirVecX
targetY = mob.TransformComponent.WorldPosition.y + dirVecY
makeCommand(_Mo
targetX = mob.TransformComponent.WorldPosition.x + dirVecX
targetY = mob.TransformCompone
targetX = mob.TransformComponent.WorldPositifalse, "Npc")
end
if timelineIndex > 0 then
mob.CurrentMap.LifeControllerComponent:RequestControl(mob, timelines, timelineIndex,
mob.CurrentMap.LifeControllerComponent:RequestControl(mob,
motrue)
end
ai:EnableNextControlTimer(nextAction)
ai:Enend
end
여기서 뭐가 문제인지를 모르겠네
실행도됨 몬스터들이 자꾸 구석으로 다 모여서 그렇지;;
| 제목 | 작성자 | 작성일 | 조회 | |
|---|---|---|---|---|
| 18798 | 01-27 | 479 | ||
| 18797 | 01-27 | 506 | ||
| 18796 | 01-27 | 528 | ||
| 18795 | 01-27 | 190 | ||
| 18794 | 01-27 | 805 | ||
| 18793 | 다클라 되시는분+4 | 01-27 | 200 | |
| 18792 | 01-27 | 459 | ||
| 18791 | 01-27 | 216 | ||
| 18790 | 01-27 | 666 | ||
| 18789 | 01-27 | 173 | ||
| 18788 | 이거 해결좀+6 | 01-27 | 395 | |
| 18787 | 666형님꺼+5 | 01-27 | 526 | |
| 18786 | 01-27 | 178 | ||
| 18785 | 01-27 | 255 | ||
| 18784 | 01-27 | 478 | ||
| 18783 | 채팅걸면 듀프만 딱줌+24 | 01-26 | 733 | |
| 18782 | 01-26 | 456 | ||
| 18781 | 01-26 | 273 | ||
| 18780 | 01-26 | 1030 | ||
| 18779 | 01-26 | 241 |
댓글8
코드가 왜이렇게 잣같이보이냐
고수가 아니니 그렇지;;; 내가 아는방식에서는 최선임..
모이는 방향이 구석이야... 이거 뭐가 잘못된거?
파일로 업로드해바
파일로 업로드를 왜해 코드가 떡하니 다나와있는데
등신임?
니 저거 보고 읽을 수 있음?
문제를 해결하기 위해 다음과 같은 접근 방식을 시도해 볼 수 있습니다:
dirVecX와 dirVecY 값을 조절하여 이동 방향을 변경합니다. 현재 스크립트에서는 dirVecX와 dirVecY를 각각 1로 설정하고 있습니다. 이 값을 적절히 조정하여 원하는 이동 방향을 설정할 수 있습니다.
targetX와 targetY의 값을 조정하여 목표 위치를 변경합니다. 현재 스크립트에서는 targetX와 targetY를 현재 위치에 dirVecX와 dirVecY를 더하여 설정하고 있습니다. 이 값을 적절히 조정하여 원하는 위치로 이동할 수 있습니다.
그렇대
파일로 해라 보기 즂같다