How do i read what a player says and reply with clientMessage , like here's and Example
if(cmd[0]=="siri"&& string == " what time is it ") { // will that work
clientMessage(" It is " + Level.getTime() );
}
if(cmd[0]=="siri" && string == " whats my gamemode") {
clientMessage("You are in " + Level.getGameMode() );
}
Will that work ? And if not please tell me how i can make it where its
How do i read what a player says and reply with clientMessage , like here's and Example
if(cmd[0]=="siri"&& string == " what time is it ") { // will that work
clientMessage(" It is " + Level.getTime() );
}
if(cmd[0]=="siri" && string == " whats my gamemode") {
clientMessage("You are in " + Level.getGameMode() );
}
Will that work ? And if not please tell me how i can make it where its
if(cmd[0]=="siri" && string == " blah ") {
}
Oh, okay. I see what you mean now.
To get the last couple of strings of the command this should work:
var msg = null;
function procCmd(cmd){
var cmd = cmd.split(' ');
if(cmd[0]=="siri"){
if(cmd.length > 0){
for(var i=1;i<cmd.length;i++){
msg = cmd[i] + " ";
}
}
}
}
I'm not really sure if this would work, but I hope you understand what I mean.
Oh, okay. I see what you mean now.
To get the last couple of strings of the command this should work:
var msg = null;
function procCmd(cmd){
var cmd = cmd.split(' ');
if(cmd[0]=="siri"){
if(cmd.length > 0){
for(var i=1;i<cmd.length;i++){
msg = cmd[i] + " ";
}
}
}
}
I'm not really sure if this would work, but I hope you understand what I mean.
I think he meant how to read what the player says. Like: If the player types in the chat "What time is it siri?" (Without /) it will say "The time is (Time)
Rollback Post to RevisionRollBack
Make sure you follow me on twitter! @DarkDiaMiner IF I post a mod download it and give me a +1 if you appreciate.
Make sure you give me a suggestion at my WIP topic darkPE
Make sure you click on that +1 button if I help you! ---------------->
I think he meant how to read what the player says. Like: If the player types in the chat "What time is it siri?" (Without /) it will say "The time is (Time)
Not possible at the moment
Rollback Post to RevisionRollBack
To post a comment, please login or register a new account.
if(cmd[0]=="siri"&& string == " what time is it ") { // will that work clientMessage(" It is " + Level.getTime() ); } if(cmd[0]=="siri" && string == " whats my gamemode") { clientMessage("You are in " + Level.getGameMode() ); }Will that work ? And if not please tell me how i can make it where its
if(cmd[0]=="siri" && string == " blah ") { }Check out my sites -> http://bukkitpe.tk , http://diamondlogic.tk
function procCmd(cmd){ if(cmd=="what time is it") clientMessage("The time is (ticks) " + Level.getTime()); }Although, wouldn't it be better to check if two specific words are in the command?
function procCmd(cmd){ if(cmd.indexOf("what") > 0 && cmd.indexOf("time") > 0) clientMessage("The time is (ticks) " + Level.getTime()); }I'm not sure if either of these would work though.To get the last couple of strings of the command this should work:
var msg = null; function procCmd(cmd){ var cmd = cmd.split(' '); if(cmd[0]=="siri"){ if(cmd.length > 0){ for(var i=1;i<cmd.length;i++){ msg = cmd[i] + " "; } } } }I'm not really sure if this would work, but I hope you understand what I mean.
I think he meant how to read what the player says. Like: If the player types in the chat "What time is it siri?" (Without /) it will say "The time is (Time)
IF I post a mod download it and give me a +1 if you appreciate.
Make sure you give me a suggestion at my WIP topic darkPE
Make sure you click on that +1 button if I help you! ---------------->