Thread: Car Trouble ~.~
View Single Post
  #5  
Old 08-28-2005, 02:24 AM
excaliber7388 excaliber7388 is offline
Banned
excaliber7388's Avatar
Join Date: Jul 2005
Location: US
Posts: 5,229
excaliber7388 can only hope to improve
Send a message via AIM to excaliber7388
this is an NPC i made for running, it allows every direction (360) it's easier this way I think any way. BTW, this doesn't have gani's in or anything, and it lets you run over walls, which is something I'm working on now (minor problem) sorry, im terrible w/ formatting
NPC Code:
// NPC made by Excaliber (Manager)
if(playerenters){
toweapons run
}
if(isweapon&&keypressed&&strequals(#p(1),I)&&!onwa ll(playerx,playery-2) &&playerhearts=playerfullhearts){
freezeplayer .05;
playery=playery-1.5
}
if(isweapon){
timeout=.05
}
if(timeout){
for (i=0;i<4;i++) {
if (keydown(i)) {
if(!onwall(playerx+vecx(i)*1.6,playery+vecy(i)*1.6 )){
playerx=playerx+vecx(i)*1.25;
playery=playery+vecy(i)*1.25;
}
}
}
}

Reply With Quote