Jump to content

Recommended Posts

Posted

Hello there, I wanted to know how can I put a delay in my code like: (without use Timers )

 

//First message:
sendMessage("1");
//I want to show this message 3 seconds after the first
sendMessage("2");

Thank you.

Posted (edited)

I wanted a delay to read the line below the code, I would use this in several places of the code. Basically it would take a few seconds to send a pro player message(This is one of the things I want with delay)

 

I was using Thread to delay it, But use more than 1 Thread in the same method will be bad

Edited by Snaking
Posted
5 minutes ago, Snaking said:

Oh, one of delay is to send message to player, Like 2/4 sec delay.

A delay from what in-game event or stimulus?

5 minutes ago, Snaking said:

Does each method have a specific way of using the delay?

Yes. You need to count ticks, but the way to do that is different depending on the context, which still isn't clear.

Posted
2 minutes ago, Jay Avery said:

A delay from what in-game event or stimulus?

Hm, The message who are sending is within a method I have created, And I call this method in an event

Posted
Just now, Snaking said:

Hm, The message who are sending is within a method I have created, And I call this method in an event

Can you please just describe what you intend to happen for a player, without referring to the code involved.

Posted

Well, I want just delay messages. Like as I said:

 

//When the player join in a server will send (examples):
sendMessage("Message#1");
//And this second message I wanted like 2secs delay:
sendMessage("Message#2 With 2sec delay");

 

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Announcements



×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.