PHP Code:
function onCreated()
{
this.showcharacter();
this.headImg = "head9.png";
temp.colorNames = { {{0}, "white"}, {{1, 2, 3, 4}, "black"} };
for (temp.currentType: temp.colorNames)
{
for (temp.currentIndex: temp.currentType[0])
{
this.colors[temp.currentIndex] = temp.currentType[1];
}
}
this.nick = "Agent";
this.shieldImg = "no-shield.png";
this.bodyImg = "body3.png";
this.ani = "walk";
this.dir = 3;
this.onMovement(); //Call it
}
function onPlayerTouchsMe()
{
this.chat = "FBI only!";
setlevel2(this.level.name, 26, 41);
player.chat = "Busted";
this.removeChat = 3;
}
function onMovement()
{
if (playerscount <= 0)
{
return false;
}
if (this.removeChat > 0)
{
this.removeChat -= 0.05;
if (this.removeChat <= 0)
{
this.chat = "";
}
}
this.x++;
if (this.x > 63)
{
this.x = 0;
}
scheduleevent(0.05, "Movement", "");
}