Quote:
Originally Posted by cyan3
This is how it would work attached to an NPC.
PHP Code:
// NPC made by Felix Lionheart
if (created) {
showcharacter;
setcharprop #3,khead12.png;
setcharprop #n,Dude;
setcharprop #8,kmabody106.png;
setcharprop #P4,bshield23.png;
setcharprop #P(1),khairs33.png;
setcharprop #P(3),bsword28.png;
setcharprop #P(5),klegs33.png;
setcharprop #P(6),kmarms117.png;
setcharprop #P7,gk_cloak7.gif;
dir = 2;
setcharani human2_sword_idle,;
ap = 100;
function onPlayerTouchsMe() {
player.guild = "Blue Team";
}
}
I myself didn't get taught scripting by anyone. I researched the graal bible and other scripts to find the functions ect.
|
Don't put functions inside of other functions, even if you are mixing GS1 with GS2 it's bad practice.
PHP Code:
// NPC made by Felix Lionheart
if (created) {
showcharacter;
setcharprop #3,khead12.png;
setcharprop #n,Dude;
setcharprop #8,kmabody106.png;
setcharprop #P4,bshield23.png;
setcharprop #P(1),khairs33.png;
setcharprop #P(3),bsword28.png;
setcharprop #P(5),klegs33.png;
setcharprop #P(6),kmarms117.png;
setcharprop #P7,gk_cloak7.gif;
dir = 2;
setcharani human2_sword_idle,;
ap = 100;
}
function onPlayerTouchsMe() {
player.guild = "Blue Team";
}