Graal Forums  

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

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 07-11-2012, 09:32 PM
Fatel Fatel is offline
Worlds Connected Dev
Join Date: Jun 2012
Posts: 18
Fatel is an unknown quantity at this point
i dont understand why this wont work, help

need help /:
PHP Code:
//#CLIENTSIDE
function onWeaponFired(){
if(
clientr.spellevel >= 10){
player.hearts player.fullhearts;
setani("lift",NULL);
}

Reply With Quote
  #2  
Old 07-11-2012, 09:55 PM
DustyPorViva DustyPorViva is offline
Will work for food. Maybe
DustyPorViva's Avatar
Join Date: Sep 2003
Location: Maryland, USA
Posts: 9,589
DustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond repute
Send a message via AIM to DustyPorViva Send a message via MSN to DustyPorViva
You can't edit player.hearts on the clientside, you'll need to trigger the server to do so:

PHP Code:
// Recieve the triggeraction, with cmd being the first parameter passed
function onActionServerside(cmd) {
  if (
cmd == "heal") {
    
player.hearts player.fullhearts;
  }
}
//#CLIENTSIDE
function onWeaponFired() {
  if(
clientr.spellevel >= 10) {
    
// Call a trigger to the server
    // "gui" simply tells it that it needs to trigger a gui, which is actually a weapon
    // name simply references the name of the weapon itself, so it's triggering itself
    // "heal" is simply a parameter you're going to pass
    
triggerserver("gui",name,"heal");
    
setani("lift",NULL);
  }

You also need to work on your formatting some so it's easier for us to read.
Reply With Quote
  #3  
Old 07-12-2012, 12:45 AM
Fatel Fatel is offline
Worlds Connected Dev
Join Date: Jun 2012
Posts: 18
Fatel is an unknown quantity at this point
im sure you have figured this out, im new
Reply With Quote
  #4  
Old 07-12-2012, 12:48 AM
Fatel Fatel is offline
Worlds Connected Dev
Join Date: Jun 2012
Posts: 18
Fatel is an unknown quantity at this point
what if i wanted to add a light image when the weapon is fired on the player?
this is most likely horribly wrong bt ill give it a shot
PHP Code:
// Recieve the triggeraction, with cmd being the first parameter passed
function onActionServerside(cmd) {
  if (
cmd == "heal") {
    
player.hearts player.fullhearts;
  }
}
//#CLIENTSIDE
function onWeaponFired() {
  if(
clientr.spellevel >= 10) {
    
//i know this is wrong just exampling
    //might be setimg not sure

    
showimg light1.png player.x,player.y;
    
triggerserver("gui",name,"heal");
    
setani("lift",NULL);
  }


Last edited by Fatel; 07-12-2012 at 01:19 AM..
Reply With Quote
  #5  
Old 07-12-2012, 11:59 AM
Skyld Skyld is offline
Script-fu
Skyld's Avatar
Join Date: Jan 2002
Location: United Kingdom
Posts: 3,914
Skyld has much to be proud ofSkyld has much to be proud ofSkyld has much to be proud ofSkyld has much to be proud ofSkyld has much to be proud ofSkyld has much to be proud of
Send a message via AIM to Skyld
Concerning showimg, take a look at http://gscript.graal.net/showimg for some details on how it works.
Concerning the thread tile, take a look at the scripting subforum rules and guidelines.
__________________
Skyld
Reply With Quote
Reply


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:25 PM.


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