![]() |
Npc problems...
Ok, here's my problem. When I make a shop, and npc's that you can buy, it works perfect in offline mode, like you can buy the npc, and it works too. But when I upload it online, you can't buy it, and even if you add it throught the RC, it still doesn't do anything. Should i put something like //#CLIENTSIDE before the script or something? I'm having the same problem with warprings. The animation plays, but it doesnt warp you even though i put the
Quote:
|
online, using NPC server, you use:
NPC Code:addweapon <name>; and the NPC code in the NPC Server weapon list, so don't use toweapons if you are. |
Re: Npc problems...
setlevel2 must be serverside, not clientside.
|
As Loriel said, setlevel2 is serverside only.
As for the shop, if you have a npcserver, the weapon must be in the npc weapon list, and you must use addweapon <weaponname> (addweapon is also serverside only) |
1 Attachment(s)
it neems like you don't quite understand the npc-server. i suggest reading the document i have attached. although it doesn't have the most updated information, it should give you an understanding of what the npc-server is and how it works.
|
thanks everyone! Yeah, im not the manager or anything, so i dont really know the npc-server. Im fairly new to graal too, maybe few hundred hours of combined time. The weapons are already on the list, so thats the same. As for the set level, do you like put //#SERVERSIDE before the setlevel index,x,y? or before the whole script? Oh and addweapon name; says its an unknown command. If you do it, it just takes money, and doesnt add anything. Oh and what about the warprings?
|
//#CLIENTSIDE in a script is a divider.
Code above it is dealt with by the server. Code below it is dealt with by the client. For this reason, there exists no //#SERVERSIDE. |
Quote:
it is an unknown command, to the client. if the addweapon command is being called serverside, it will work the way it is designed to. what about 'em? i think loriel answered your question. |
I think you are having trouble coordinating the clientside parts of your script with the supposed-to-be-serverside setlevel2... ?
|
Quote:
Note by Loriel: This is not true. |
Quote:
|
ok, heres the script, whats wrong with it?
---------------------------------------------------- //#CLIENTSIDE if (playerenters&&!hasweapon(Town Main Warp)) {show; } if (playerenters&&hasweapon(Town Main Warp)) {hide; } if (playertouchsme) { toweapons Town Main Warp; hide; } if (weaponfired&&!strequals(#L,serverstart.graal)) { freezeplayer 1.5; playerdir=2; sleep .05; playery=playery-.1; playerdir=3; sleep .05; playery=playery-.1; playerdir=0; sleep .05; playery=playery-.1; playerdir=1; sleep .05; playery=playery-.1; playerdir=2; sleep .05; playery=playery-.1; playerdir=3; sleep .05; playery=playery-.1; playerdir=0; sleep .05; playery=playery-.1; playerdir=1; sleep .05; playery=playery-.1; playerdir=2; sleep .05; playery=playery-.1; playerdir=3; sleep .05; playery=playery-.1; playerdir=0; sleep .05; playery=playery-.1; playerdir=1; sleep .05; playery=playery-.1; playerdir=2; sleep .05; playery=playery-.1; playerdir=3; sleep .05; playery=playery-.1; playerdir=0; sleep .05; playery=playery-.1; playerdir=1; sleep .05; playery=playery-.1; playerdir=2; sleep .05; playery=playery-.1; playerdir=3; sleep .05; playery=playery-.1; playerdir=0; sleep .05; playery=playery-.1; playerdir=1; sleep .05; playery=playery-.1; playerdir=2; sleep .05; playery=playery-.1; playerdir=3; sleep .05; playery=playery-.1; playerdir=0; sleep .05; playery=playery-.1; playerdir=1; sleep .05; playery=playery-.1; playerdir=2; } //#SERVERSIDE setlevel2 serverstart.graal; ------------------------------------------------------- |
oh dear GOD
Read -> Think -> Think some more -> Reread -> Think about what you read -> Post, we've already said //#SERVERSIDE doesn't exist |
Quote:
|
it just doesnt warp... it does the ani but doesnt warp... cant figure it out :confused:
|
1.) Dice -> You can't use addweapon clientside
2.) Use [code] tags if you're posting scripts 3.) THERE IS NO SUCH THING AS //#SERVERSIDE. |
Quote:
Although i think it would be alot easier than all this triggeraction serverside clientside bull****. Functions nested in a //#SERVERSIDE would probably be much less taxing than triggeractions left right and center, and since functions will support parameters in v3 it should be easy to replace triggeraction. |
Quote:
NPC Code: PS: server-side only. |
Quote:
|
Quote:
removed for posting full scirpts, you are not going to help him at all by doing so, he wont learn and will keep begging for more -Jagen This ofcourse won't work properly, but i hope you've got the idea... |
I'll explain something and i hope this will help you.
You want to make a weapon wich will warp you to a specified level, then, add a weapon to weapons list. Put the script there; I won't post a full script but i'll give some explanations. Like some people already said, if you use '//#CLIENTSIDE', what is written above that 'declaration' will work server-side and what is written below the 'declaration' will work client-side, since setlevel2 works server-side, where will you put the command at? Think about it. Try to learn about triggeraction on weapons, because you'll need that to trigger the warp action from server-side to client-side to warp you. That's all you have to know to make it work successful. |
Perhaps this is easier to understand mention that from a security point of view, it would be _stupid_ to allow the client to use setlevel2. Think about it.
And, think about using more informative thread titles in the future. |
First off I'd suggest shorting your code a lot by looking into how to use for () loops.
Also, look around on the forums for examples on how to do clientside to serverside through weapons (Its been explained enough that no one should have to post about it again). You will find the script is actually quite short and simple. |
Quote:
Try to use a for loop instead of all the sleeps, or a timeout because Kai dun like a for with sleep. To set the level, but at the end of the fancy-warpy-stuff a triggeraction 0,0,serverside,<parameters>. Above the //#CLIENTSIDE, put a NPC Code: To trigger serverside... Do you actually know how triggeraction works? |
Quote:
|
Stefan :o
|
If you want to make a warp ...
In a weapon : NPC Code: In a NPC in a Level : NPC Code: Kay ? :) |
| All times are GMT +2. The time now is 03:55 AM. |
Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.