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 07-09-2009, 01:12 AM
GULTHEX GULTHEX is offline
Registered User
Join Date: Jul 2008
Posts: 148
GULTHEX can only hope to improve
Smile help with my script

PHP Code:
//#CLIENTSIDE
if (weaponfired && onwater(players[0].x,players[0].y)){
setani fishing,fishrod2.png;
freezeplayer 3;
player.rupees =+ int(random(1,5));
fishedweight strtofloat(#s(fishedwieght))+fishweight;
setplayerprop #c,I got a fish ;
sleep 2;

when i fire the weapon near the water it works fine

but when i get the money

it goes to the number of rupees


whats wrong with it?

then goes back to my origional

so example

if ifire it

it changes my rupees to 3

1 second later

it changes back to 0
Reply With Quote
  #2  
Old 07-09-2009, 01:22 AM
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
player.rupees can only truly be edited on the serverside like so.

PHP Code:
function onActionServerSide() {
  if (
params[0] == "caughtfish") {
    
player.rupees += int(random(1,5));
  }
}

//#CLIENTSIDE

function onFishCaught() {
  
triggerserver("gui"name"caughtfish");

And because you're using GS2 you can write the weaponfired like so..

PHP Code:
//#CLIENTSIDE
function onWeaponFired() {
  
// if stuff
   // do stuff

__________________
Quote:
Reply With Quote
  #3  
Old 07-09-2009, 01:25 AM
GULTHEX GULTHEX is offline
Registered User
Join Date: Jul 2008
Posts: 148
GULTHEX can only hope to improve
online i own a server
Reply With Quote
  #4  
Old 07-09-2009, 01:35 AM
GULTHEX GULTHEX is offline
Registered User
Join Date: Jul 2008
Posts: 148
GULTHEX can only hope to improve
okay iv got another problem now


function onActionServerSide() {
if (params[0] == "caughtfish") {
player.rupees += int(random(1,5));
}
}

//#CLIENTSIDE
if (weaponfired && onwater(players[0].x,players[0].y)){
setani fishing,fishrod2.png;
freezeplayer 1;
setplayerprop #c,I got a #int pound fish ;
triggerserver("gui", name, "caughtfish");
sleep 2;
}



it says i caught a #int fish

not the int number

how would i do that
Reply With Quote
  #5  
Old 07-09-2009, 01:35 AM
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
Please read these articles then The scripting guides, and the GS1 to GS2 should definitely be read.

http://graal.net/index.php/Creation/Dev/GScript

They should be quite helpful.

Edit:

You need to have a variable that holds how big the fish was first.

Then you can do:

PHP Code:

player
.chat "I caught a " int(variable) @ "!"
Substituting variable with what you picked of course.
__________________
Quote:
Reply With Quote
  #6  
Old 07-09-2009, 01:38 AM
GULTHEX GULTHEX is offline
Registered User
Join Date: Jul 2008
Posts: 148
GULTHEX can only hope to improve
thank you very much
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 12:09 PM.


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