Graal Forums  

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

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 04-30-2011, 11:13 AM
JesusFreak250 JesusFreak250 is offline
Vendetta
Join Date: Nov 2010
Location: United Kingdom
Posts: 262
JesusFreak250 will become famous soon enough
Help needed

hey I'm currently learning to script and I was on testbed just playing about trying to make a gralat script so that the player can make there gralats go up to 1000. It seems to work fine but after about 0.5 of a second the gralats go back to what i had before i used the weapon. I'm guessing it's something to do with it being clientside and it needs to be serverside but I'm not sure. So i need some help to make it work. I know its probably really bad but its one of my first attempt.

HTML Code:
//#CLIENTSIDE
  
  function onKeyPressed(code, key, scancode) {
   
   if (key == "3") {
    
    player.rupees = 1000;
  }
 }
Reply With Quote
  #2  
Old 04-30-2011, 11:24 AM
Starfire2001 Starfire2001 is offline
Unholy Nation
Starfire2001's Avatar
Join Date: Dec 2010
Location: The streets.
Posts: 156
Starfire2001 will become famous soon enough
http://forums.graalonline.com/forums...ghlight=rupees
Reply With Quote
  #3  
Old 04-30-2011, 03:14 PM
fowlplay4 fowlplay4 is offline
team canada
fowlplay4's Avatar
Join Date: Jul 2004
Location: Canada
Posts: 5,200
fowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond repute
Quote:
Originally Posted by Starfire2001 View Post
If you're going to link to a thread at least make an attempt to explain the problem in short.

The problem is that player.rupees is synchronized with the value on the serverside. So when it updates it on the player's client-side it sets it back to it's real value instead of the one u set on the client-side.

Therefore you need to set it on the server-side, one of the ways to do this in a weapon is to use triggerserver. There's an example by cbk here:

http://forums.graalonline.com/forums...84&postcount=6

Also, please be more descriptive with your thread titles. I.e: Issue with player.rupees reseting

One of the greatest sources of documentation is the answers to people's issues on the forums, so it helps when it's easily found by thread title.
__________________
Quote:
Reply With Quote
  #4  
Old 04-30-2011, 03:23 PM
JesusFreak250 JesusFreak250 is offline
Vendetta
Join Date: Nov 2010
Location: United Kingdom
Posts: 262
JesusFreak250 will become famous soon enough
Ahh ok thanks =]
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 10:36 PM.


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