matthew123456
New Member
- Joined
- Aug 24, 2013
- Messages
- 124
- Reaction score
- 4
does anyone have or could make a killed monsters counter for tfs 1.2 thanks n advance
guys im getting an error in function name attempt to call local name a string value
local monster = {
['dragon'] = 123456
}
function onKill(creature, target)
if creature:isPlayer() and target:isMonster() then
local name = target:getName():lower()
if monster[name] then
local storage = creature:getStorageValue(monster[name])
local count = math.max(0, storage) + 1
creature:setStorageValue(monster[name], count)
creature:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "You have killed " .. count .. "x " .. name ".")
end
end
return true
end
that is screenshot of error
that is screenshot of error
local monster = {
['dragon'] = 123456
}
function onKill(creature, target)
if creature:isPlayer() and target:isMonster() then
local name = target:getName():lower()
if monster[name] then
local storage = creature:getStorageValue(monster[name])
local count = math.max(0, storage) + 1
creature:setStorageValue(monster[name], count)
creature:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "You have killed " .. count .. "x " .. name .. ".")
end
end
return true
end
corrected thanksCode:local monster = { ['dragon'] = 123456 } function onKill(creature, target) if creature:isPlayer() and target:isMonster() then local name = target:getName():lower() if monster[name] then local storage = creature:getStorageValue(monster[name]) local count = math.max(0, storage) + 1 creature:setStorageValue(monster[name], count) creature:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "You have killed " .. count .. "x " .. name .. ".") end end return true end