Scripting School
Would you like to react to this message? Create an account in a few clicks or log in to continue.

New to scripting? We want you!

Official Ventrilo: Host:Apollo.MaxFrag.net Port:3840
TestBed needs our help! Please donate a few dollars to keep it running here!
Have you mastered a specific part of GS2? Create a guide and help others!

You are not connected. Please login or register

Assignment 2

Go down  Message [Page 1 of 1]

1Assignment 2 Empty Assignment 2 Mon May 02, 2011 10:34 pm

ZeusCondero


Admin

Topics for assignment:

Events

http://forums.graalonline.com/forums/showpost.php?p=1494270&postcount=1

http://wiki.graal.us/CategoryFunctionEvent

Variables
http://gs2.graalstudios.com/?page=variables

Style
Practice your formatting. When something is between brackets, it should be indented to the proper level. See below for an example

Code:
function onCreated()
{
  this.name = "Twinny";
  this.age = 19;
  this.band = "The Smashing Pumpkins";
  echo("My name is" SPC this.name  @". I am" SPC this.age SPC "and my favourite band is" SPC this.band);
}

Assignments
1.Format this script:
Code:
for(i = 0; i < passedeffects.tokenize(",").size(); i ++){temp.effect = passedeffects.tokenize(",")[i].tokenize(":"); temp.effectroll = random(0,100); if(effectroll <= effect[0] && effect[1] == "cause"){BuffSystem.addbuff(effect[2],effect[3],effect[4],effect[5],effect[6]); }}

Hint: Look at the example above. Notice that there are semicolons or brackets at the start or end of a line, now look for those.

2. Using Variables, create a script that creates changes players attributes.

3. Take the script you created above and make it check to see if a player is a classic or gold account WHEN GRABBED. If a player is Gold have it do hat13. If the player is Classic hat 2.png.

Hint: the grab function is not built in, you have to set it up with a script.

4. Using your script in part 2, create a simple hat setter so that a player can say "/sethat hat12.png".

Back to top  Message [Page 1 of 1]

Permissions in this forum:
You cannot reply to topics in this forum