가장가까운 떨어진 아이템을 알고싶어요!
local get_nearItem = function()
local localPlayer = _UserService.LocalPlayer
local localPlayerPos = localPlayer.TransformComponent.WorldPosition
local box = BoxShape(Vector2(0,0), Vector2(100,100), 0)
local simulator = _CollisionService:GetSimulator(localPlayer.CurrentMap)
local temp = {}
local output = {}
local hit = simulator:OverlapAllFast(CollisionGroups.MapleDrop, box, temp)
local nearestItem = nil
local nearestDistance = 100
for _, drop in ipairs(temp) do
local dropComponent = drop.Entity.DropComponent
if (isvalid(dropComponent) and dropComponent.ReservedDestroy == 0) then
if _ItemDropLogic:CheckDropOwner(dropComponent.OwnType, dropComponent.OwnId, dropComponent.CreateTime, localPlayer, true) then
local dropPos = drop.Entity.TransformComponent.WorldPosition
local dx = dropPos.x - localPlayerPos.x
local dy = dropPos.y - localPlayerPos.y
local distance = math.sqrt(dx * dx + dy * dy)
if distance < nearestDistance then
nearestDistance = distance
nearestItem = drop
end
end
end
end
return nearestItem
end우선 순위중 가장 가까운 몬스터를 알고싶어요
local firstMobTemplateIDs = {'다크 스톤골렘','레드 드레이크'}
local filter_nearest_mob = function()
local localPlayerPos = _UserService.LocalPlayer.TransformComponent.WorldPosition
local box = BoxShape(Vector2(0,0), Vector2(100,100), 0)
local simulator = _CollisionService:GetSimulator(_UserService.LocalPlayer.CurrentMap)
local temp = {}
local hit = simulator:OverlapAllFast(CollisionGroups.MapleMob, box, temp)
local nearestMob = nil
local nearestDistance = 100
local firstMob = nil
local firstMobDistance = nearestDistance
for _, mob in ipairs(temp) do
local mobPos = mob.Entity.TransformComponent.WorldPosition
local mobCom = mob.Entity.MobComponent
if (mobCom.DeadType ~= -1) then
continue
end
local dx = mobPos.x - localPlayerPos.x
local dy = mobPos.y - localPlayerPos.y
local distance = math.sqrt(dx * dx + dy * dy)
for _, firstMobTemplateID in ipairs(firstMobTemplateIDs) do
if _StringMan:GetMobName(mobCom.MobTemplateID) == firstMobTemplateID and distance < firstMobDistance then
firstMobDistance = distance
firstMob = mob
break
end
end
if distance < nearestDistance then
nearestDistance = distance
nearestMob = mob
end
end
nearestMob = firstMob or nearestMob
return nearestMob
end기타창이 꽉 찻는지 알고싶어요
local is_full_extitem = function()
local cd = _UserService.LocalPlayer.WsCharacterData
local ExtSlotcount = 0
for j=1,cd.ItemMaxSlot[4],1 do
local item = cd:GetItem(4, j)
if (item ~= nil) then
ExtSlotcount = ExtSlotcount+1
end
end
if(ExtSlotcount >=cd.ItemMaxSlot[4]) then
return true
else
return false
end
end| 제목 | 작성자 | 작성일 | 조회 | |
|---|---|---|---|---|
| 공지 | 게시판 이용 안내+156 | 10-20 | 22082 | |
| 61640 | 10:15 | 26 | ||
| 61639 | 09:53 | 30 | ||
| 61638 | 08:19 | 38 | ||
| 61637 | 03:00 | 126 | ||
| 61636 | 11-06 | 167 | ||
| 61635 | 11-06 | 157 | ||
| 61634 | 11-06 | 179 | ||
| 61633 | 11-05 | 405 | ||
| 61632 | 11-05 | 298 | ||
| 61631 | 11-05 | 321 | ||
| 61630 | 11-05 | 293 | ||
| 61629 | 11-05 | 493 | ||
| 61628 | 11-04 | 456 | ||
| 61627 | 11-04 | 560 | ||
| 61626 | 11-04 | 694 | ||
| 61625 | 11-04 | 666 | ||
| 61624 | 11-03 | 690 | ||
| 61623 | 11-03 | 771 | ||
| 61622 | 11-03 | 823 |
댓글8
개추
형 로나월드 주문제작좀ㅜ
저는 개발조언만하지 스크립트 판매는 안해여!
ㅜㅠ 후 구하기힘드네여
쌉추
개추
야스
글 ㅈㄴ 맛있네