Ir para conteúdo

Featured Replies

Postado

Boa tarde pessoal, meu script de ver o frag estábugado, ele está assim :

 

Citar

    local kills = math.ceil(skullTime / fragTime)

 

   a variavel para calcular os frags, porem a saida está saindo isso :

 

Citar

   14:25 You have 30 unjustified kills. The amount of unjustified kills will decrease after: 8 hours, 4 minutes and 24 seconds.

 

sendo q o player tem 3, 4 , 5 , tanto faz o frag, sai isso, então resolvi tentar uma alteração

 

trocando o local kills por este:

Citar

local kills = db.getResult("SELECT kills FROM players WHERE account_id =" ..player:getAccountId()..";")

 

porem da erro na hora de executar o arquivo :

Citar

data/talkactions/scripts/kills.lua:14: attempt to call field 'getResult' (a nil value)
stack traceback:
        [C]: in function 'getResult'
        data/talkactions/scripts/kills.lua:14: in function <data/talkactions/scripts/kills.lua:1>

 

alguem poderia me ajudar o que está de errado ? e poderia me passar as funções do TFS 1.2 ?

Postado

Qual datapack você utiliza ?

 

@edit achei um aqui, vê se funciona.

 

Spoiler

function onSay(player, words, param)

	local fragTime = configManager.getNumber(configKeys.FRAG_TIME)
	if fragTime <= 0 then
		player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "You do not have any unjustified kill.")
		return false
	end

	local skullTime = player:getSkullTime()
	if skullTime <= 0 then
		player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "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_STATUS_CONSOLE_BLUE, message)
	return false
end

 

 

Editado por Enzo Caue
found script (veja o histórico de edições)

Participe da conversa

Você pode postar agora e se cadastrar mais tarde. Se você tem uma conta, faça o login para postar com sua conta.

Visitante
Responder

Quem Está Navegando 0

  • Nenhum usuário registrado visualizando esta página.

Estatísticas dos Fóruns

  • Tópicos 96.9k
  • Posts 519.8k

Informação Importante

Confirmação de Termo