Graal Forums  

Go Back   Graal Forums > Development Forums > NPC Scripting
FAQ Members List Calendar Today's Posts

 
 
Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1  
Old 07-21-2001, 05:32 PM
Jerom Jerom is offline
Banned
Jerom's Avatar
Join Date: Mar 2001
Location: In a Trash Can
Posts: 3,708
Jerom is on a distinguished road
Send a message via AIM to Jerom
Unhappy Needs help with keydown

To start out this post...I suck at scripting!!!
I was making the starting movement for a race and I couldn't make it so that the player stops using walk.gani and uses idle.gani when the player isn't moving. Right now the player just moves all the time.
Here's the script, could you help me out(i added the onwall incase that may be of any good use)?:
if (playertouchsme) {
toweapons System;
disabledefmovement;
timeout=0.05;}
if (timeout) {
if (keydown(0)){
playerdir = 0;
playery-=0.5;
setani walkslow,;
}
if (keydown(1)){
playerdir = 1;
playerx-=0.5;
setani walkslow,;
}
if (keydown(2)){
playerdir = 2;
playery+=0.5;
setani walkslow,;
timeout=0.05;
}
if (keydown(3)){
playerdir = 3;
playerx+=0.5;
setani walkslow,;
}
timeout=0.05;
//left detection
if (onwall(playerx+0.5,playery+1.5)) {playerx+=0.5}
if (onwall(playerx+0.5,playery+2)){playerx+=0.5}

//right detection
if (onwall(playerx+2,playery+1.5)) {playerx-=0.5}
if (onwall(playerx+2,playery+2)) {playerx-=0.5}

//down detection
if (onwall(playerx+0.5,playery+2.5)) {playery-=0.5}
if (onwall(playerx+1,playery+2.5)) {playery-=0.5}
if (onwall(playerx+1.5,playery+2.5)) {playery-=0.5}

//up detection
if (onwall(playerx+0.5,playery+1)) {playery+=0.5}
if (onwall(playerx+1,playery+1)) {playery+=0.5}
if (onwall(playerx+1.5,playery+1)) {playery+=0.5}
Reply With Quote
 


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 06:47 AM.


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