adrenyslopez
Member
- Joined
- Dec 22, 2015
- Messages
- 201
- Reaction score
- 15
Hi, someone will have the !frags command for tfs 1.3 otbr
That it is working, pass one to revscriptsys but it does not count the frags it always says
This is the one I have and it doesn't work for me
That it is working, pass one to revscriptsys but it does not count the frags it always says
Lua:
You do not have any unjustified kill.
This is the one I have and it doesn't work for me
Code:
local frags = TalkAction("!frags")
function frags.onSay(player, words, param)
local fragTime = configManager.getNumber(configKeys.FRAG_TIME)
if fragTime <= 0 then
player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You do not have any unjustified kill.")
return false
end
local skullTime = player:getSkullTime()
if skullTime <= 0 then
player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You do not have any unjustified kill.")
return false
end
local kills = math.ceil(skullTime / fragTime)
local remainingSeconds = math.floor((skullTime % fragTime) / 1000)
local hours = math.floor(remainingSeconds / 3600)
local minutes = math.floor((remainingSeconds % 3600) / 60)
local seconds = remainingSeconds % 60
local message = "You have " .. kills .. " unjustified kill" .. (kills > 1 and "s" or "") .. ". The amount of unjustified kills will decrease after: "
if hours ~= 0 then
if hours == 1 then
message = message .. hours .. " hour, "
else
message = message .. hours .. " hours, "
end
end
if hours ~= 0 or minutes ~= 0 then
if minutes == 1 then
message = message .. minutes .. " minute and "
else
message = message .. minutes .. " minutes and "
end
end
if seconds == 1 then
message = message .. seconds .. " second."
else
message = message .. seconds .. " seconds."
end
player:sendTextMessage(MESSAGE_EVENT_ADVANCE, message)
return false
end
frags:separator(" ")
frags:register()