I made this bot outline because i was bored and decided to post to learn from/ make fun off ;D etc etc so feel free to modifiy it, it's default.
//NPC Made by Merlin
if (created) {
showcharacter;
setcharprop #3,head0.gif;
setcharprop #C0,orange;
setcharprop #C1,white;
setcharprop #C2,blue;
setcharprop #C3,red;
setcharprop #C4,black;
setcharprop #2,shield1.gif;
shieldpower = 1;
dir = 2;
this.loaded = true;
setcharprop #n,Default Bot;
setstring this.life,3;
timeout = .5;
}
if (timeout) {
message #s(this.life);
timeout=.5;
}
if (playertouchsme) {
if (playerdir==0) {
say2
Commands:#b
Shoot - Make Bot Shoot if loaded#b
Reload - Reload the bot's shot#b
Walk Up - walk up#b
Walk Down - walk down#b
Walk Left - walk left#b
Walk Right - walk right#b
Show Stats - Show the current Stats#b
of Bot#b
}
}
if (playerchats&&strequals(#c,show stats)) {
say2
Current Bot Stats:#b
Current bot life: #s(this.life)#b
}
if (playerchats&&strequals(#c,shoot)) {
if (this.loaded==true) {
setcharani shoot,;
shootarrow dir;
this.loaded = false;
}
}
if (playerchats&&strequals(#c,reload)) {
this.loaded = true;
}
if (playerchats&&strequals(#c,walk up)) {
walkup();
}
if (playerchats&&strequals(#c,walk down)) {
walkdown();
}
if (playerchats&&strequals(#c,walk left)) {
walkleft();
}
if (playerchats&&strequals(#c,walk right)) {
walkright();
}
function walkup() {
dir = 0;
setcharani walk,;
y=y-.5;
sleep.3;
y=y-.5;
sleep.3;
y=y-.5;
sleep.3;
y=y-.5;
sleep.3;
y=y-.5;
sleep.3;
y=y-.5;
sleep.3;
setcharani idle,;
}
function walkdown() {
dir = 2;
setcharani walk,;
y=y+.5;
sleep.3;
y=y+.5;
sleep.3;
y=y+.5;
sleep.3;
y=y+.5;
sleep.3;
y=y+.5;
sleep.3;
y=y+.5;
sleep.3;
setcharani idle,;
}
function walkleft() {
setcharani walk,;
dir = 1;
x=x-.5;
sleep.3;
x=x-.5;
sleep.3;
x=x-.5;
sleep.3;
x=x-.5;
sleep.3;
x=x-.5;
sleep.3;
x=x-.5;
sleep.3;
setcharani idle,;
}
function walkright() {
setcharani walk,;
dir = 3;
x=x+.5;
sleep.3;
x=x+.5;
sleep.3;
x=x+.5;
sleep.3;
x=x+.5;
sleep.3;
x=x+.5;
sleep.3;
x=x+.5;
sleep.3;
setcharani idle,;
}
if (washit) {
setstring this.life,#v(strtofloat(#s(this.life))-1);
timeout = .5;
}
if (wasshot) {
setstring this.life,#v(strtofloat(#s(this.life))-1);
timeout = .5;
}
if (timeout) {
if (strequals(#s(this.life),0)){
sprite = 40;
timeout = 1;
setstring this.life,3;
setcharani idle,;
timeout=.5;
}
}
if (timeout) {
if (strequals(#s(this.life),-1)){
setstring this.life,0;
}
}
if (timeout) {
if (strequals(#s(this.life),-2)){
setstring this.life,0;
}
}
if (timeout) {
if (strequals(#s(this.life),-3)){
setstring this.life,0;
}
}
if (timeout) {
if (strequals(#s(this.life),-4)){
setstring this.life,0;
}
} |