376
Forum Games / Glider's Future [Picture Game]
« on: September 24, 2012, 09:40:37 PM »You have appeared in a room with a door and a crate, what do you do?
This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.
%obj = new scriptObject(tank)
{
var1 = 40;
var2 = 20;
};
tank.kill();
function tank::kill()
{
(coding here)
}But what I am trying to do is place an object inside another object, if it's possible can somebody tell me how
package Chatbot
{
$wins = 0;
$losses = 0;
function clientCmdChatMessage(%a, %b, %c, %fmsg, %cp, %name, %cs, %msg)
{
parent::clientCmdChatMessage(%a, %b, %c, %fmsg, %cp, %name, %cs, %msg);
if(%name !$= $Pref::Player::NetName)
return;
}
if(%msg $= "RPSBot" && getWordCount(%msg) == 2)
{
%attack[1] = "rock";
%attack[2] = "scissors";
%attack[3] = "paper";
$fattack = random($attack)
$word = getWord(%msg,2);
switch$(%word)
{
case "rock"
{
if($fattack $= "rock"
{
commandToServer('messageSent',"We both chose rock.. I guess it's a tie. You have "@$wins@" wins and "@$losses@" losses.");
}
if($fattack $= "scissors";
{
commandToServer('messageSent',"Man, I lost. I chose scissors. You have "@$wins@" wins and "@$losses@" losses.");
$wins += 1;
}
if($fattack $= "paper";
{
commandToServer('messageSent',"Yay! I chose paper! You have "@$wins@" wins and "@$losses@" losses");
$losses += 1;
}
case "scissors"
{
if($fattack $= "rock"
{
commandToServer('messageSent',"Yay! I chose rock! You have "@$wins@" wins and "@$losses@" losses.");
$losses += 1;
}
if($fattack $= "scissors";
{
commandToServer('messageSent',"We both chose scissors.. I guess it's a tie. You have "@$wins@" wins and "@$losses@" losses.");
}
if($fattack $= "paper";
{
commandToServer('messageSent',"Man, I lost. I chose paper. You have "@$wins@" wins and "@$losses@" losses");
$wins += 1;
}
case "paper"
{
if($fattack $= "rock"
{
commandToServer('messageSent',"Man, I lost. I chose rock. You have "@$wins@" wins and "@$losses@" losses.");
$wins += 1;
}
if($fattack $= "scissors";
{
commandToServer('messageSent',"Yay! I chose scissors! You have "@$wins@" wins and "@$losses@" losses.");
$losses += 1;
}
if($fattack $= "paper";
{
commandToServer('messageSent',"We both chose paper.. I guess it's a tie. You have "@$wins@" wins and "@$losses@" losses");
}
}
}
}

