Graal Forums  

Go Back   Graal Forums > Development Forums > NPC Scripting
FAQ Members List Calendar Search Today's Posts Mark Forums Read

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 12-08-2009, 12:04 PM
Samposse Samposse is offline
Chopa Shopa !
Samposse's Avatar
Join Date: Nov 2008
Location: Norway
Posts: 87
Samposse is an unknown quantity at this point
Send a message via AIM to Samposse Send a message via MSN to Samposse
i am learning scripting to but i only can simple stuff as
PHP Code:
//#CLIENTSIDE 

function onPlayerChats(){
return;
player.chat "im Muted and cant talk !"
... i need a good tutorial ...

and i know some basic Var stuff as

PHP Code:
funcion onCreated() {
var
.1 "Hello World";
echo var
.1
__________________
Delitto :3

A
SERVER
UNDER
CONSTRUCTION !

feel free to ask me about delitto
Reply With Quote
  #2  
Old 12-08-2009, 12:10 PM
Twinny Twinny is offline
My empire of dirt
Twinny's Avatar
Join Date: Mar 2006
Location: Australia
Posts: 2,422
Twinny is just really niceTwinny is just really nice
Send a message via AIM to Twinny
Quote:
Originally Posted by Samposse View Post

PHP Code:
funcion onCreated() {
var
.1 "Hello World";
echo var
.1
It's a mix between languages there... this would work better

PHP Code:
function onCreated()
{
  
this.var1 "Hello World!";
  echo(
this.var1);

GS2 (the current language) requires the use of ( ) to designate a function. The reason that may work is because gs1 used the 'function var' syntax without the use of parenthesis. Also, while var.1 would technically work, it's a strange way of doing it within gscript

As for the other script, placing a, "return; straight after the function is caused would stop the execution right there as returns stop what the function is doing and returns a result to the original caller (in this case, 0 since no value was supplied. I am not sure what you were trying to achieve with that return
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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 10:31 PM.


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