Posted April 8, 20178 yr 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.
April 8, 20178 yr What is the context? When and how do you want this to happen, in gameplay terms (not code terms)?
April 8, 20178 yr Author 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 April 8, 20178 yr by Snaking
April 9, 20178 yr Author Oh, one of delay is to send message to player, Like 2/4 sec delay. Does each method have a specific way of using the delay?
April 9, 20178 yr 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.
April 9, 20178 yr Author 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
April 9, 20178 yr 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.
April 9, 20178 yr Author 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");
April 9, 20178 yr Author 1 minute ago, Jay Avery said: So you want the messages to happen with a delay when the player joins the server? Yeah
April 9, 20178 yr Author @diesieben07 This example you sent, I can use in all of my code or this is just when play join on server?
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.