Author Topic: Help with a script im making  (Read 1695 times)

To parent clientCmdChatMessage you'd want parent::clientCmdChatMessage(%a,%b,%c,%fmsg,%cp,%name,%cs,%msg);

To parent NMH_Type::send you'd want parent::send(%this);

It depends which one you're using, it appears you're using clientCmdChatMessage but before you edited that in you were using NMH_Type::send, so I have no idea what you're doing.

For fixing the syntax error, see my post above yours.

To parent clientCmdChatMessage you'd want parent::clientCmdChatMessage(%a,%b,%c,%fmsg,%cp,%name,%cs,%msg);

To parent NMH_Type::send you'd want parent::send(%this);

It depends which one you're using, it appears you're using clientCmdChatMessage but before you edited that in you were using NMH_Type::send, so I have no idea what you're doing.

For fixing the syntax error, see my post above yours.
that fixes it. Thanks you and jes00 for helping me!

Okay im back with another issue, when i try to use the $murderer it just gives me a blank space.

That's because you defined it as a local variable in your script. Change it to $murderer = if you want it to be global.

Also, do realize that every single time someone sends any message it will pick a new murderer.

That's because you defined it as a local variable in your script. Change it to $murderer = if you want it to be global.

Also, do realize that every single time someone sends any message it will pick a new murderer.

How do I stop it from picking a new murderer each time?

How do I stop it from picking a new murderer each time?

That's where logic comes into play. Simple if checks are what you need, and a better way to pick a new murderer. Those global variables would best be put outside of the package.
« Last Edit: February 13, 2014, 07:28:33 PM by elm »

That's where logic comes into play. Simple if checks are what you need, and a better way to pick a new murderer. Those global variables would best be put outside of the package.
what would those simple if checks be?

Well, you should probably move the code to select a murderer to inside "!start". You'll also need a logic check to make sure they don't restart the game before the murderer is found, so you'll want to have something like if($murderer == 0) surrounding the code. Then whenever the game ends set $murderer = 0; so that somebody can start the game with !start again.

Its giving me an error when I try to make the end command set the murder variable to 0
Code: [Select]
if(%this.getValue() $= "!end")
{
NewChatSO.addLine("<color:ffffff>You'll have to start over again, sorry.");
$murderer = 0
}##
##
//endevidence//

//beginsuspects//


This may sound dumb, but is this possible?

Code: [Select]
if(%this.getValue() $= "!pick Martin Snow")
{
if($murderer == %s6)
                        {
                                newChatSO.addLine("<color:00ff00>You got the murderer!");
                         }
                        else
                        {
                                newChatSO.addLine("<color:00ff00>You didnt get the murderer!");
                         }
}

I don't see why it wouldn't be, assuming both $murderer and %s6 are numerical values.