Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   NPC Scripting (https://forums.graalonline.com/forums/forumdisplay.php?f=8)
-   -   Guard (https://forums.graalonline.com/forums/showthread.php?t=9184)

Metal-Slug 08-09-2001 04:52 AM

Guard
 
Im making a gaurd, so that when somone in my guild says move, it walks down, the turns to the right or left, then stops, then faces down, the, when the guild member says go back, it walks back to his post.

CrazedMerlin 08-09-2001 07:06 AM

ok

Metal-Slug 08-09-2001 07:16 AM

umm, ok, i at least need some one to help me start

08-09-2001 09:15 AM

Easy...


NPC Code:

// NPC by Ice Pick
if (created) {
// Initialize the attributes
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;
hearts = 3;
}

if(strequals(#g,your guild)&&strequals(#c,move)) {
this.move = 1;
timeout = 0.05;
if(x = 11) {
this.move = 2;
if(y = 10) {
this.move = 3;
}
}
}

if(this.move = 1) {
dir = 3;
x+=0.2;
setcharani walk,;
timeout = 0.05;
}
if(this.move = 2) {
dir = 2;
y+=0.2;
setcharani walk,;
timeout = 0.05;
}
if(this.move = 3) {
dir = 1;
setcharani idle,;
x=x;
y=y;
}



you can change the x, and y's arround if you want. I just put thoughs in their to test it.

this.move = 1 is for moving right
this.move = 2 is for moving down
this.move = 3 is for turning left and stoping.

Metal-Slug 08-09-2001 11:57 PM

thank you man, try not to ask unless i cant figure it out


All times are GMT +2. The time now is 05:01 PM.

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.