Thread: Learning GS2 :D
View Single Post
  #10  
Old 09-01-2006, 05:45 PM
Draenin Draenin is offline
Magnificent Bastard
Draenin's Avatar
Join Date: Dec 2004
Location: Bermuda Triangle
Posts: 6,790
Draenin has much to be proud ofDraenin has much to be proud ofDraenin has much to be proud ofDraenin has much to be proud ofDraenin has much to be proud ofDraenin has much to be proud of
Send a message via AIM to Draenin Send a message via MSN to Draenin Send a message via Yahoo to Draenin
Quote:
Originally Posted by killerogue
What's wrong with me using
PHP Code:
this.StringArray = {"foo","bar","baz"}; 
Because that format is mainly used for arrays, which are a little different than a plain variable.

This is a lot more efficient, though: (Not to mention, it should work.)
PHP Code:
function onCreated()
{
this.value 0;
}
function 
onPlayerTouchsMe()
{
if (
this.value 0);
this.value 1;
player.chat "On!";
}
else
{
this.value 0;
player.chat "Off!";

The else case is a bit unnecessary, though, as the variable this.value will stay at 0 unless you change it, which you have done in your if case.
Reply With Quote