Graal Forums  

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

 
 
Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #4  
Old 03-25-2007, 02:04 PM
godofwarares godofwarares is offline
Webmaster
godofwarares's Avatar
Join Date: Dec 2006
Location: Florida
Posts: 552
godofwarares is on a distinguished road
Send a message via ICQ to godofwarares Send a message via AIM to godofwarares Send a message via MSN to godofwarares Send a message via Yahoo to godofwarares
Quote:
Originally Posted by Twinny View Post
Umm... you can't set a players sword power or hearts clientside. Also, this.firstpower and this.firsthearts are undefined. You also managed to mix up the order (clientr. is set when the player leaves?).

I'll write it in GS2 first and i'll try and work it out in GS1
PHP Code:
function onCreated()
{
  
this.sethearts=10;
  
this.setsword=2;
}

function 
onPlayerEnters()
{
  
player.clientr.setsword player.swordpower;
  
player.clientr.sethearts player.fullhearts;
  
player.swordpower this.setsword;
  
player.fullhearts this.sethearts;
  
player.chat "Default stats set!";
}

function 
onPlayerLeaves()
{
  
player.swordpower player.clientr.setsword;
  
player.fullhearts player.clientr.sethearts;
  
player.clientr.setsword "";
  
player.clientr.sethearts "";
  
player.chat "Original Stats Restored";

In GS1:

PHP Code:
if (created)
{
     
this.sethearts 10;
     
this.setsword 2;
}

if (
playerenters)
{
     
setstring clientr.setswordplayerswordpower;
     
setstring clientr.setheartsplayerfullhearts;
     
playerswordpower this.setsword;
     
playerfullhearts this.sethearts;

     
setplayerprop #c,Default stats set!;
}

if (
playerleaves)
{
     
playerswordpower clientr.setsword;
     
playerfullhearts clientr.sethearts;
     
setstring clientr.setsword,;
     
setstring clientr.sethearts,;

     
setplayerprop #c,Original Stats Restored;


* I love how when people ask for GS1, everyone gives him GS2 ...
__________________
What signature? I see no signature?
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 06:58 PM.


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