Quote:
Originally Posted by Jiroxys7
Man, i'm having some serious bad luck with scripting or something lately. My movement system project bombed since it was doing something weird and wouldnt let up after a few days of trying to figure out what was causing it. And maybe related but i cant incorporate that system you posted either. I eventually got to the point where i dropped the custom movement system, and put your code in a seperate npc. played around with it (yes, i fixed the typo) and still no luck. it wasnt updating anything at all. not even with a simple timeout script. i eventually turned THAT into
PHP Code:
//#CLIENTSIDE
function onTimeout(){
player.chat = "!";
}
setTimer(0.05);
and yet my player.chat does not equal "!"; so then i thought, maybe some other script is updating my chat that i somehow forgot to delete, and changed it to player.x += 1; no luck. i think im starting to lose it cuz this makes no sense at all. i ended up rechecking about 4-5 times that i actually added that timeout loop npc to myself AND that the script was free of errors (yes, that simple, few lines of code). @_@
i think i'm going to have to hire a scripter. because this is driving me nuts  does anyone know any trustworthy ones out there who might be willing to script for me and who arent, you know, like ultra-shady or anything? :/
|
You have code outside of functions which is never good. Here's a proper version:
PHP Code:
//#CLIENTSIDE
function onCreated() {
// Begin Loopiing
setTimer(0.05);
}
function onTimeout() {
// Do something..
player.chat = player.chat+1;
// Continue Looping
setTimer(0.05);
}
You should keep loops like that to the absolute minimum, and try to develop things based on events (onPlayerChats, onPlayerEnters, etc.) instead.
The code I provided, if you want to use that function (onSetAni2) in other scripts you just have to paste it in the script you want to use it.
If you need scripting help feel free to ask the GDT, the scripter to everything else ratio there is pretty high. Keep in mind as long as you aren't script begging you should be able to get a lot of help from the NPC Scripting section.