Im making sort of a game with the chat and I need help with this.
Im trying to make it so that one specific person will be chosen at random to be the murderer, but I dont know if im doing it right.
The variable im referencing to is the %murder = %s[%selected]
package game
{
function clientCmdChatMessage(%a,%b,%c,%fmsg,%cp,%name,%cs,%msg)
{
//VARIABLES//
%s1 = "Mr. Patrith";
%s2 = "Ms. Funkleberry";
%s3 = "Simon Ghinly";
%s4 = "Jon Verning";
%s5 = "Alvin Feldgim";
%s6 = "Martin Snow";
%selected = getrandom(1,6)
%murderer = %s[%selected]
//ENDVARIABLES//
parent::clientCmdChatMessage(%a,%b,%c,%fmsg,%cp,%name,%cs,%msg);
if(%msg $= "!murder")
{
NewChatSO.addLine("<color:00ff00>INDEX");
NewChatSO.addLine("<color:ffffff>!HELP/INFO");
NewChatSO.addLine("<color:ffffff>!COMMANDS");
NewChatSO.addLine("<color:ffffff>!PLAY");
}
if(%msg $= "!Help/info")
{
NewChatSO.addLine("<color:00ff00>GUIDE");
NewChatSO.addLine("<color:ffffff>You are J. V. Wattingsworth, an experienced detective. When a murder comes about, it is up to you to solve it.");
NewChatSO.addLine("<color:ffffff>Examine the clues and question the suspects to find the murderer.");
}
if(%msg $= "!play")
{
NewChatSO.addLine("<color:00ff00>STORY");
NewChatSO.addLine("<color:ffffff>You are walking down the hotel hallway when you hear a scream.");
NewChatSO.addLine("<color:ffffff>You rush to the scene and find a body, freshly murdered.");
NewChatSO.addLine("<color:ffffff>Within hours you have collected enough evidence and suspects/witnesses. Now you just need to solve the case.");
NewChatSO.addLine("<color:00ff00>Type !start to begin");
}
if(%msg $= "!start")
{
NewChatSO.addLine("<color:00ff00>GAME");
NewChatSO.addLine("<color:ffffff>Type !suspects to see the suspects");
NewChatSO.addLine("<color:ffffff>Type !evidence to see the evidence");
NewChatSO.addLine("<color:ffffff>Type !examine evidencehere to examine the evidence")
}
if(%msg $= "!suspects")
{
NewChatSO.addLine("<color:00ff00>SUSPECTS");
NewChatSO.addLine("<color:ffffff>Mr. Patrith");
NewChatSO.addLine("<color:ffffff>Ms. Funkleberry");
NewChatSO.addLine("<color:ffffff>Simon Ghinly";");
NewChatSO.addLine("<color:ffffff>Jon Verning";");
NewChatSO.addLine("<color:ffffff>Alvin Feldgim";");
NewChatSO.addLine("<color:ffffff>Martin Snow";");
}
}
};
activatepackage(game);