![]() |
more scripting
for this script it works fine offline but yet again won't work online with npcserver. What needs to be changed to get it to function properly:
if (playerenters) { timereverywhere; timeout=.05; xmove=0; ymove=0; } if(timeout){ timeout=.05; if(playery<66&&playerx<64){ if(playersprite>0&&playersprite<9){ if(abs(xmove)<1.5){ if(playerdir=3) xmove+=.1; if(playerdir=1) xmove-=.1; } if(abs(ymove)<1.5){ if(playerdir=2) ymove+=.1; if(playerdir=0) ymove-=.1; } } if(xmove>0){ if (!onwall((playerx+xmove+2),playery)&& !onwall((playerx+xmove+2),(playery+1))&& !onwall((playerx+xmove+2),(playery+2))){ playerx+=xmove; xmove-=.05; }else{ xmove=0; } } if(xmove<0){ if (!onwall((playerx+xmove),playery)&& !onwall((playerx+xmove),(playery+1))&& !onwall((playerx+xmove),(playery+2))){ playerx+=xmove; xmove+=.05; }else{ xmove=0; } } if(ymove>0){ if (!onwall(playerx,(playery+2+ymove))&& !onwall((playerx+1),(playery+2+ymove))&& !onwall((playerx+2),(playery+2+ymove))){ playery+=ymove; ymove-=.05; }else{ ymove=0; } } if(ymove<0){ if (!onwall(playerx,(playery+ymove))&& !onwall((playerx+1),(playery+ymove))&& !onwall((playerx+2),(playery+ymove))){ playery+=ymove; ymove+=.05; }else{ ymove=0; } } if(abs(xmove)<.05) xmove=0; if(abs(ymove)<.05) ymove=0; } else{ ymove=0; xmove=0 } } |
you must change everywhere it says if to else, and everywhere it says else to if
|
one thing I noticed just scrolling down really fast is your timeout
you have to timeout=0.1 (you cant do 0.05 on npc server unless it is clientside) |
ty
aww crap. Yeah this has to be serverside...hmmm maybe it'll look okay with that delay 0.o thx kjs
|
That script could be cut down a lot using vector X and Y.... =\
Also there are some Really long stuff that dont need to be tehre butr ill let you figure it out. You learn better if its not done for you. |
you can cut it down alot also by using an array of the onwall+loop instead of putting a whole bunch of if's
|
Quote:
|
| All times are GMT +2. The time now is 11:23 AM. |
Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.