Thread: Boots
View Single Post
  #4  
Old 11-18-2008, 07:27 AM
Bl0nkt Bl0nkt is offline
Era Developer
Bl0nkt's Avatar
Join Date: Mar 2005
Location: Pennsylvania
Posts: 1,589
Bl0nkt will become famous soon enough
Send a message via AIM to Bl0nkt
Quote:
Originally Posted by Pelikano View Post
Hello, once again I need some help.
I am trying to script my own boots.. but it doesn't work for some reason:

NPC Code:
//#CLIENTSIDE
function onWeaponFired() { 1
if (this.disabled == false) { 2
disabledefmovement(); 3
this.disabled = true; 4
setTimer(0.05); 5
}elseif (this.disabled = true) 6
enabledefmovement(); 7
setTimer(0); 8
} 9
function onTimeout() { 10
for (i = 0; i < 4; i++) { 11
if (keydown(i)) { 12
player.dir = i; 13
player.x += vecx(player.dir); 14
player.y += vecy(player.dir); 15
} 16
} 17
setTimer(0.05); 18
} 19



Any idea why?
Okay, I've added numbers to each of the lines so I can explain easier.

Problem 1: On line 6, you only have "=" when the operator should be "==". I figure this is more of a typo than a mistake though, since you did fine at the top.

Problem 2: You do not set "this.disabled" back to false after line 6. You're going to need to add another line of code to set this variable, which also means you're going to need brackets to support the new number of operations (more than one, which is currently only the function "enabledefmovement();")

Other than that, it seems fine. You might also want to replace the animation "push" with "walk" so that you don't start pushing the wall as you run.
Reply With Quote