
02-07-2002, 06:48 AM
|
|
Registered User
|
 |
Join Date: Aug 2001
Posts: 710
|
|
Game Control
|
I am making a game where there are 2 buttons. when a player grabs one it sets focus on a area and they control one of the 2 NPCs inside there.
My code so far looks like this...
// NPC made by Lord Helmut
if (created) {
x+=.4;
y+=.7;
}
if (playertouchsme&&keydown(6)) {
setstring server.axegameplayer,#a;
setfocus 31,28;
disabledefmovement;
playersprite=19;
say2 Do you want to play?;
timereverywhere;
}
Thats the code so far for the button. For some reason u have to hold A and run at it to get it to work LOL.
// Graal2002 NPC by Stefan Knorr
if (created) {
showcharacter;
setcharprop #3,head0.png;
setcharprop #C0,orange;
setcharprop #C1,white;
setcharprop #C2,blue;
setcharprop #C3,red;
setcharprop #C4,black;
setcharprop #2,noshield.gif;
dir = 3;
}
if(timeout){
tokenize #s(server.axegameplayer);
if(strequals(#a,#t(1))){
if(keydown(3)){
x+=5;
timeout=.05;
}
timeout=.05;
}
}
Thats the character NPC. I want it so it can be controlled by the player touching to button but its not working for some reason |
__________________

Check out the development at:
http://razza.org/lordhelmut/FantasyTales/index
|
|
|
|