Logarithmic
Harvard Student
Alright, well I'm new too LUA and I'm trying to learn how to use tables correctly, but I cant figure out how to shorten this script using tables but I'm almost positive it can be done. Here is an example script i'd like shortened.
Code:
local pn = getCreatureName(cid)
if getPlayerStorageValue(player, 4001) == 20 then
doBroadcastMessage(pn .." is on killing spree! 20 kills.")
elseif getPlayerStorageValue(player, 4001) == 40 then
doBroadcastMessage(pn .." is on killing spree! 40 kills.")
elseif getPlayerStorageValue(player, 4001) == 60 then
doBroadcastMessage(pn .." is on killing spree! 60 kills.")
elseif getPlayerStorageValue(player, 4001) == 80 then
doBroadcastMessage(pn .." is on killing spree! 80 kills.")
elseif getPlayerStorageValue(player, 4001) == 100 then
doBroadcastMessage(pn .." is on killing spree! 100 kills.")
elseif getPlayerStorageValue(player, 4001) == 150 then
doBroadcastMessage(pn .." is on killing spree! 150 kills.")
elseif getPlayerStorageValue(player, 4001) == 200 then
doBroadcastMessage(pn .." is on killing spree! 200 kills.")
elseif getPlayerStorageValue(player, 4001) == 300 then
doBroadcastMessage(pn .." is on killing spree! 300 kills.")