채팅0

    고수들아 코딩 질문점

    조회수 355
    return function (self) 
    local modelName = self.Entity.Model.Name
    local spl = _UtilLogic:Split(modelName, "_")
    
    local id = tonumber(spl[1])
    local mobName = spl[2]
    if mobName == "m" then
    	mobName = _MonsterData:GetMonsterName(id)
    end
    
    self.id = id
    
    local hitBoxTable = _MonsterData:GetMonsterHitBox(id)
    if hitBoxTable == nil then
    	return
    end
    
    --★★★
    if luna_zz.use_invin then
    local x = tonumber(hitBoxTable["x"]) / 100
    local y = tonumber(hitBoxTable["y"]) / 100
    local hx = tonumber(hitBoxTable["hx"]) / 100
    local hy = tonumber(hitBoxTable["hy"]) / 100
    local cx = tonumber(hitBoxTable["cx"]) / 100
    local cy = tonumber(hitBoxTable["cy"]) / 100
    
    else
    local x = tonumber(hitBoxTable["x"]) / 1
    local y = tonumber(hitBoxTable["y"]) / 1
    local hx = tonumber(hitBoxTable["hx"]) / 10
    local hy = tonumber(hitBoxTable["hy"]) / 10
    local cx = tonumber(hitBoxTable["cx"]) / 10
    local cy = tonumber(hitBoxTable["cy"]) / 10
    
    end
    --★★★
    
    self.boxX = x
    self.boxY = y
    self.head.x = hx
    self.head.y = hy
    
    local buffBox = self.Entity:GetChildByName("buffBox1")
    if buffBox ~= nil then
    	local pos = buffBox.TransformComponent.Position
    	pos.x = -self.head.x
    	pos.y = self.head.y
    end
    
    local tri = self.Entity.TriggerComponent
    if tri ~= nil then
    	tri.ColliderOffset = Vector2(cx, cy)
    	tri.BoxSize = Vector2(x, y)
    	if self:IsClient() then
    		tri.Enable = true --not self.noHit
    	end
    end
    
    if self:IsClient() then
    	local mobData = _MonsterData:GetMonster(id)
    	self.clientTColor = _GameUtil:ConvertValue(mobData["hpTagColor"], 0)
    	self.clientBColor = _GameUtil:ConvertValue(mobData["hpTagBgcolor"], 0)
    	if self.clientTColor == 0 and self.clientBColor == 0 then
    		local hpBar = _SpawnService:SpawnByModelId("model://ee08026b-c1e4-4d13-954d-2e26ecd443a9", "HpBar", Vector3(0, y + 0.2, 0), self.Entity)
    		hpBar.SpriteRendererComponent.SortingLayer = self.Entity.SpriteRendererComponent.SortingLayer
    		hpBar.SpriteRendererComponent.OrderInLayer = self.Entity.SpriteRendererComponent.OrderInLayer
    		hpBar.TransformComponent.Position.z = -0.0001
    		local black = hpBar:GetChildByName("Black")
    		black.SpriteRendererComponent.SortingLayer = self.Entity.SpriteRendererComponent.SortingLayer
    		black.SpriteRendererComponent.OrderInLayer = self.Entity.SpriteRendererComponent.OrderInLayer
    		black.TransformComponent.Position.z = -0.0002
    		
    		hpBar:SetEnable(false)
    		self.hpBar = hpBar
    		self.black = black
    		self.blackTrans = black.TransformComponent
    		
    		self.Entity.NameTagComponent.Name = "<size=0.8>Lv." .. self.level .. "</size> " .. mobName
    	end
    end
    end

    내가 별표친데 몹 hitbox 명령어에 따라 변경하고싶은데

    기본값은 false고

    이거 왜 동작 안되는지 알려주라

    댓글6

    회원프로필

    --

    2024.02.29 10:50
    회원프로필

    별표는 그냥 표시한거여

    2024.02.29 10:50
    회원프로필

    스크립트 감사용

    2024.02.29 10:52
    회원프로필

    이거야 워낙 뿌려진거라

    2024.02.29 10:54
    회원프로필

    에잉 뿌린거만 받아 쓰는 애들한테 내가 뭘 바라겠냐
    직접 찾아봐야지

    2024.02.29 11:02
    회원프로필

    zzzz

    2024.02.29 12:26

      게시글 리스트
      제목작성자작성일조회
      공지10-2016708
      5816903:0593
      5816801:07152
      5816710-27140
      5816610-27206
      5816510-27169
      5816410-27149
      5816310-27200
      5816210-27231
      5816110-27220
      5816010-27674
      5815910-26712
      5815810-26522
      5815710-26537
      5815610-26701
      5815510-26829
      5815410-25772
      5815310-25804
      5815210-25775
      5815110-251188
      안내 배너 이미지