![]() |
Scripting with NPC Server offline!
How can I script a NPC to a p2p server that is not up yet??? What are the basic commands??? Like this... I want to script these NPCs to work in a p2p server... How can I do???
// NPC Made by CyberX if(playerenters){ this.power=0; } if (actionlumbing) { message #v(this.power)% done; lumbpower = strtofloat(#p(0)); this.power +=lumbpower; sleep 0.05; putleaps 3,x+2,y; } if (this.power=100) { message 100% done.; putleaps 3,x,y; putleaps 3,x+1,y; putleaps 3,x+2,y; putleaps 3,x+3,y; putleaps 3,x+4,y; sleep 0.05; this.plus=1+strtofloat(#s(client.lumber)); setstring client.lumber,#v(this.plus); say2 Total of wood: #s(client.lumber); destroy; } and // NPC made by CyberX if (strtofloat(#s(client.lumber))>19) { set wood1; } if (playertouchsme&&!wood1) { say2 Not enough wood!; } if (playertouchsme&&wood1&&money1) { say2 You've already gotten a #bwoodpack! } if (playertouchsme&&w1) { say2 You've already gotten a #bwoodpack! } if (playertouchsme&&wood1&&!w1&&!w2&&!money1&&!money2 ) { timeout = 1; putleaps 3,x+2,y; this.less=strtofloat(#s(client.lumber))-20; setstring client.lumber,#v(this.less); set w1; freezeplayer 3; } if (timeout) { putleaps 3,x+2,y; } |
Re: Scripting with NPC Server offline!
NPC Code: NPC Code: there, I have added comments where corrections are necessary, fix that up, and it should work inside NPC-Server |
what do you mean with "should be inside an event"???
|
events are things like
if (playerenters) if (playertouchsme) events are not things like if (issparringzone) if (keydown(i)) |
Quote:
|
-=Josey=-
Keydown is a function. It's called locally by the client's Graal.exe. An event is called by the NPC or a server. Correct me if I'm wrong here anyone. |
-=Josey=-
Heh, I wasn't looking for a "better word", I was looking for a correct answer. |
i wish stefan would make keydown a event, instead of a function
|
The problem most people don't understand is that NPCs don't run CONSTANTLY. They run only when they need to. So if you got a NPC with this code:
NPC Code: The if(keydown(0)) will ONLY work if the NPC is activated while the player is hold down the UP key. People put keydown() in loops because the script is ACTIVE and it will pick up the keydown. I hope somebody can help me on this. Wanna give it a try Kaimetsu? |
Actually also you can do this i remember:
NPC Code: because it was activated and than it was continuing...right? sorry about the keydown(i) i was kinda tired, now i realixe cause you can't call it alone. |
Quote:
|
| All times are GMT +2. The time now is 06:24 AM. |
Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.