![]() |
grabbed
what is the function for grabbed?
i have tryed everything it doesnt work x.x does it have to be clientside? |
There is no function for grabbing. You can, however, script your own. You'll find the solution in this thread.
|
Thanks works like a charm also cbk thanks for all the help in the previous scripts ive made graal forums has such a nice community. :)
Also i need help with /copy "Graal757488" "body" how would i get to to do that? to tokenize it and put like if(temp.token[2] == "body") and etc. |
Do you understand the difference between serverside and clientside (trying to decide how much I need to explain)?
|
Quote:
|
Quote:
There are essentially two different ways you script: on serverside, or on clientside. If a script is serverside, it means that the NPC-server interprets and performs the code. The advantage to this is that you know the code can't be tamperered with. If the code is clientside, it means that it is ran on the computer of the player. This has the advantage of being faster and not requiring communication with the server, but has the disadvantage of being less secure. Since serverside is not performed for a specific player it cannot display interface graphics (HUDs, etc). It also can't handle player chat events, among others. To communicate between the server and the client you use something called a trigger. In the past this was accomplished with the triggerAction function, but now it's standard practice to use triggerServer and triggerClient. Simply enough, triggerServer is used to send a "trigger", or a message, from clientside (a player's computer) to the NPC-server. Similarly, triggerClient is used to send a "trigger" from the NPC-server to a player's computer. The simplest trigger from clientside to server would work like so: PHP Code:
PHP Code:
PHP Code:
The script types that you can trigger are "gui" or "weapon", which both trigger a weapon script. Scripters have their own personal preference on which to use, but it doesn't really matter. The other script type is "npc", which triggers a database NPC. If you don't know what that is, don't worry about it yet. Adding the trigger code would look like so: PHP Code:
Then, you would need to "tokenize" the player's chat. This is the same as the explode function found in PHP and other languages. It splits the string into different parts at the "delimiter". You can specify a custom delimiter for str.tokenize(str delimiter), but in this case there is no need to. PHP Code:
PHP Code:
PHP Code:
PHP Code:
|
Thanks, this makes me understand alot better. I have bein scripting for a while but I quit for a year or two. Just got back into Graal Deving about 2 days ago and i want to get my mojo back on. :D thanks <3
|
| All times are GMT +2. The time now is 05:42 PM. |
Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.