가장가까운 떨어진 아이템을 알고싶어요!
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 | 22364 | |
| 61784 | 14:11 | 29 | ||
| 61783 | 07:32 | 77 | ||
| 61782 | 12-21 | 222 | ||
| 61781 | 12-21 | 280 | ||
| 61780 | 12-21 | 272 | ||
| 61779 | 12-19 | 491 | ||
| 61778 | 12-18 | 625 | ||
| 61777 | 12-18 | 1014 | ||
| 61776 | 12-16 | 1099 | ||
| 61775 | 12-14 | 1246 | ||
| 61774 | 12-14 | 1556 | ||
| 61773 | 12-14 | 1477 | ||
| 61772 | 12-13 | 1361 | ||
| 61771 | ㅁㄹH막힘?+1 | 12-13 | 1749 | |
| 61770 | 12-12 | 1687 | ||
| 61769 | 12-11 | 2312 | ||
| 61768 | 12-10 | 2335 | ||
| 61767 | 12-10 | 2122 | ||
| 61766 | 12-09 | 2020 |
댓글8
개추
형 로나월드 주문제작좀ㅜ
저는 개발조언만하지 스크립트 판매는 안해여!
ㅜㅠ 후 구하기힘드네여
쌉추
개추
야스
글 ㅈㄴ 맛있네