Jump to content

Help Socorro


threevictor

Recommended Posts

English:  Hello friends, I have a problem with this script posted below, I am a beginner in the moon language, and I would like to know how I can use the setTimer function to give a 2 second delay in the outputChatBox.

Portuguese:  Olá amigos,Estou com um problema nesse script postado a baixo,sou iniciante na linguagem lua,e gostaria de saber como posso usufruir da função setTimer,para dar um delay de 2 segundos no outputChatBox.

function HandlerWasted()
    valor = math.random( 170, 500 )
	outputChatBox("#FFFFFFForam cobrados #FBFF00 $"..tostring ( valor )..",00 #FFFFFFpelos seus gastos no hospital",source,255,255,255,true)
	valor = takePlayerMoney(source, valor)
end
addEventHandler("onPlayerWasted",getRootElement(), HandlerWasted)

 

Link to comment
2 hours ago, #banana said:

English:  Hello friends, I have a problem with this script posted below, I am a beginner in the moon language, and I would like to know how I can use the setTimer function to give a 2 second delay in the outputChatBox.

Portuguese:  Olá amigos,Estou com um problema nesse script postado a baixo,sou iniciante na linguagem lua,e gostaria de saber como posso usufruir da função setTimer,para dar um delay de 2 segundos no outputChatBox.


function HandlerWasted()
    valor = math.random( 170, 500 )
	outputChatBox("#FFFFFFForam cobrados #FBFF00 $"..tostring ( valor )..",00 #FFFFFFpelos seus gastos no hospital",source,255,255,255,true)
	valor = takePlayerMoney(source, valor)
end
addEventHandler("onPlayerWasted",getRootElement(), HandlerWasted)

 

setTimer(function, timer, executes, arguments...)

function HandlerWasted()
    valor = math.random( 170, 500 )
	setTimer(outputChatBox, 2000, 1, "#FFFFFFForam cobrados #FBFF00 $"..tostring ( valor )..",00 #FFFFFFpelos seus gastos no hospital",source,255,255,255,true)
	valor = takePlayerMoney(source, valor)
end
addEventHandler("onPlayerWasted",getRootElement(), HandlerWasted)

 

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...