Dbzl
New Member
- Joined
- Jan 22, 2017
- Messages
- 34
- Reaction score
- 1
Thanks to @Colandus for showing me how it's done in tfs 1.x in a thread while ago.
This isn't the best code ever, but it was what I could do with some info @Colandus sent me. =p
@ edited the code so it can follow the tfs coding pattern
Code:
function Position:sendAnimatedNumber(message_type, text, value, color)
local message_type = message_type or MESSAGE_EXPERIENCE
local color = color or TEXTCOLOR_BLUE
local valid_message_types = {
MESSAGE_DAMAGE_DEALT,
MESSAGE_DAMAGE_OTHERS,
MESSAGE_DAMAGE_RECEIVED,
MESSAGE_EXPERIENCE,
MESSAGE_HEALED,
MESSAGE_HEALED_OTHERS,
}
assert(isInArray(valid_message_types, message_type), "invalid 'message_type', must output to server log")
for _, v in ipairs(Game.getSpectators(self, false, true)) do
if v:isPlayer() then
v:sendTextMessage(message_type, text, self, value, color)
end
end
end
This isn't the best code ever, but it was what I could do with some info @Colandus sent me. =p
@ edited the code so it can follow the tfs coding pattern
Last edited: