Graal Forums  

Go Back   Graal Forums > Development Forums > NPC Scripting > New Scripting Engine (GS2)
FAQ Members List Calendar Today's Posts

 
 
Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1  
Old 08-31-2006, 04:41 PM
killerogue killerogue is offline
Registered Omega
killerogue's Avatar
Join Date: Apr 2006
Location: United States
Posts: 1,920
killerogue is on a distinguished road
Send a message via AIM to killerogue Send a message via MSN to killerogue
Learning GS2 :D

I was problem solving with Chicken yesterday and he was teaching me about each aspect of GS2. So I learned alot really. Here's a couple things I put together with Chicken_l33t.

Simple Light Switch

PHP Code:
function onCreated()
{
this.Number_1 0;
this.Number_2 0;
if (
this.Number_1 this.Number_2 0);
this.value 0;
}
function 
onPlayertouchesme()
{
if (
this.value 0);
this.value 1;
player.chat "On!";
}
else 
{
this.value 0;
player.chat "Off!";

Chat Text Changer

PHP Code:
function onCreated()
{
this.StringArray "GS1 sux.","GS2 is awesome.","blah";
}
function 
onPlayerchats()
{
this.value int(random(0,2));
player.chat this.StringArray[this.value];

How'd I do for a beginner?

E: Eew wasn't in PHP. My bad. :]
__________________


REMEMBER, IF YOU REP ME, LEAVE A NAME!

Quote:
Originally Posted by haunter View Post
Graal admins don't die. They go to hell and regroup.
Quote:
Originally Posted by Inverness View Post
Without scripters, your graphics and levels wouldn't do anything but sit there and look pretty.
Reply With Quote
 


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 12:52 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.