-- ... (existing code)
-- Function to teleport the pet to a specific position
local function teleportToPosition(position)
setWaitingServer()
self:RequestPetAction("TELEPORT", 0, position.x, position.y)
clearSweepTarget()
end
-- NEW CODE: Function to command the pet to pull an item towards itself
local function pullItemToPet(item)
setWaitingServer()
self:RequestPetAction("PULL_ITEM", 0, item.EntityId) -- Assuming "PULL_ITEM" is a valid pet action
clearSweepTarget()
end
-- ... (existing code)
-- Check for sweepable drops
local sdrops = getSweepableDrops()
if (#sdrops > 0) then
for i = 1, #sdrops do
local drop = sdrops[i]
local dropPos = drop.TransformComponent.WorldPosition
local dropId = drop.DropComponent.DropId
local timeout = self.SweepTemporaryExceptions[dropId] or 0
if (timeout > now) then
-- Drop is temporarily excluded
continue
end
-- Pull the item towards the pet
pullItemToPet(drop)
self.SweepTemporaryExceptions[dropId] = now + 10
self.SweepTarget = nil -- No need to set a sweep target as we are pulling the item
return
endend
-- NEW CODE: Pull a random item towards the pet if no sweepable drops are found
if (isvalid(self.SweepTarget) == nil) then
-- Assuming getRandomSweepableDrop() is a function that returns a random sweepable drop
local randomDrop = getRandomSweepableDrop()
if (isvalid(randomDrop)) then
-- Pull the random item towards the pet
pullItemToPet(randomDrop)
endend
-- ... (remaining code)
흠.....
| 제목 | 작성자 | 작성일 | 조회 | |
|---|---|---|---|---|
| 10589 | 짱똘형꺼+6 | 01-17 | 335 | |
| 10588 | 01-17 | 251 | ||
| 10587 | 01-17 | 597 | ||
| 10586 | 01-17 | 252 | ||
| 10585 | 01-17 | 773 | ||
| 10584 | 01-17 | 385 | ||
| 10583 | 01-17 | 348 | ||
| 10582 | 펫박 스크립트+4 | 01-17 | 701 | |
| 10581 | 01-17 | 172 | ||
| 10580 | 01-17 | 224 | ||
| 10579 | 01-17 | 769 | ||
| 10578 | 01-17 | 265 | ||
| 10577 | 다클 루아인식+3 | 01-17 | 300 | |
| 10576 | 01-17 | 637 | ||
| 10575 | 01-17 | 396 | ||
| 10574 | 01-17 | 6578 | ||
| 10573 | 01-17 | 1430 | ||
| 10572 | 01-17 | 717 | ||
| 10571 | 01-17 | 440 | ||
| 10570 | 01-17 | 181 |
댓글4
oh
루아 게임스크립트 어디안에 넣는거야?
파일올려주면 좋은데 ㅠㅠ 초보는 웁니다.
텔포도하고 템박도하는거임?