Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- This function is called everytime a damage number should be created, instead of the original function
- function onDamageNumberCreate(dam_nums, number, loc, is_shield)
- -- Create a new instance of DamageNumber. The default time that it takes before a damage number fades out is 1.70
- local num = DamageNumber(number, 1.70, loc, is_shield)
- -- Set the original color
- num.color = rgb(255, 255, 255)
- -- Add the new damage number to the original array
- dam_nums:add(num)
- end
- -- This function is called once per frame to update the attributes of the damage numbers and draw them
- function onDamageNumberUpdate(dam_nums, hud, delta)
- local i = 0
- local total = 0
- local curr
- -- Loop over every damage numbers
- while i < dam_nums:size() do
- curr = dam_nums:get(i)
- curr.time = curr.time - delta
- if curr.time <= 0 then
- dam_nums:remove(i)
- i = i - 1
- else
- total = total + curr.number
- end
- i = i + 1
- end
- local loc = Vector(curr.location.x, curr.location.y, curr.location.z)
- drawDamageNumber(hud, tostring(curr.number), curr.color, loc, 1, 1)
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement