![]() |
triggerserver/triggeraction
triggerserver("gui", this.name, "summon", player.chat.substring(8));
I often read lines like this and got near no clue how to use them. someone can help me? and also: player.chat.substring(8) is it is it 8 because of /summon Schetti 12345 67 8? ya I know I am noob ... |
Quote:
I'll explain. this.name = the current weapon name, for example, Staff/Summon you could manually write it in if you wanted to: PHP Code:
Parameters are what needs to be sent to the server. Triggerserver/triggeraction are used to send information to the same server. There is no difference between the two when working with weapons, but triggeraction has more features if you're triggering level npcs, etc, but I won't get into that here. For example, PHP Code:
PHP Code:
Substring is used in almost all scripting/coding languages in this format. Certain languages allow you to do negative substrings which makes it easier to chop off the ending of the string, however, this is how Graal's works: PHP Code:
PHP Code:
PHP Code:
So, let's use both of them, just to make sure you got it down. Let's say I want to see the middle characters of player.chat. This means if I said: 'abcde' it would show 'c' PHP Code:
|
triggerserver("gui", this.name, "summon", player.chat.substring(8));
so its: ni weapname casena needed to cut down first 8 ni=no idea this helped quite alot. (cat, tomcat) why thats needed? PHP Code:
just that I dont fail to see sense of triggerserver it makes it able to "react" a function, right? |
Quote:
Triggerserver sends data that you're using on the clientside, over to the serverside. For example, mousex/mousey are only accessible on the clientside. PHP Code:
Let's say you NEED that data (mousex/ mousey) serverside so you can do certain serverside-only commands. You can send your mousex/mousey serverside like this. PHP Code:
So, after doing triggerserver, this is what will be sent serverside: PHP Code:
|
this hardly helps me, I always had problems with serverside-clientside only commands
:D |
WOOOT!
Ive just tryed: PHP Code:
IT WORKS! I think ive got all I wanted atm! thanks ^^ another step for a 13 years old boy into a great world of scripting |
because the level name is a string and needs to be surround by quotes, otherwise it is read as variable. Also it is bad styling to have commands outside functions, so here what I would do.
PHP Code:
|
scripting is lame sometimes just because ""
|
Quote:
If you don't have quotes, it thinks it's a variable. How is it supposed to differentiate between variables and strings? PHP Code:
|
it would echo bar
because it would echo the tempfoo and temp.foo = "bar" makes the foo it would echo to bar and could you explain why in nearly each explain with scripts theres a foo and a bar needed? are those 2 words so nice? o.o |
Quote:
Quote:
|
temp.foo = "foo";
echo(foo); |
Quote:
PHP Code:
PHP Code:
|
wouldn't
PHP Code:
and I like circles you can go ROUNDnROUNDnROUNDnROUNDnROUNDnROUNDnROUNDnROUND |
Quote:
|
All times are GMT +2. The time now is 04:12 PM. |
Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.