가장가까운 떨어진 아이템을 알고싶어요!
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| 제목 | 작성자 | 작성일 | 조회 | |
|---|---|---|---|---|
| 35292 | 02-13 | 960 | ||
| 35291 | 02-13 | 762 | ||
| 35290 | 02-13 | 1048 | ||
| 35289 | 02-13 | 452 | ||
| 35288 | 02-13 | 674 | ||
| 35287 | 02-13 | 787 | ||
| 35286 | 02-13 | 456 | ||
| 35285 | 몹텔 구해봅니다+2 | 02-13 | 489 | |
| 35284 | 02-13 | 490 | ||
| 35283 | 02-13 | 1128 | ||
| 35282 | 02-13 | 957 | ||
| 35281 | 02-13 | 790 | ||
| 35280 | 02-13 | 1681 | ||
| 35279 | 02-13 | 479 | ||
| 35278 | 02-12 | 449 | ||
| 35277 | 02-12 | 1757 | ||
| 35276 | 02-12 | 1047 | ||
| 35275 | 02-12 | 1195 | ||
| 35274 | 02-12 | 547 | ||
| 35273 | 02-12 | 597 |
댓글8
개추
형 로나월드 주문제작좀ㅜ
저는 개발조언만하지 스크립트 판매는 안해여!
ㅜㅠ 후 구하기힘드네여
쌉추
개추
야스
글 ㅈㄴ 맛있네