Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   NPC Scripting (https://forums.graalonline.com/forums/forumdisplay.php?f=8)
-   -   Strings and Var! (https://forums.graalonline.com/forums/showthread.php?t=14205)

SSRobgeta 10-09-2001 06:42 AM

Strings and Var!
 
I need help on this! It won't work!

// Created By Rob Getashu
if (created) {
// Initialize the attributes
showcharacter;
setcharprop #3,head0.gif;
setcharprop #C0,orange;
setcharprop #C1,white;
setcharprop #C2,blue;
setcharprop #C3,red;
setcharprop #C4,black;
setcharprop #2,shield1.gif;
shieldpower = 1;
dir = 2;
}
if (playerchats&&strequals(#c,sell lumber)) {
this.lumber = strtofloat(#v(client.lumber);
playerrupees+=this.lumber;
setstring client.lumber,;
setstring server.gavelumber,#v(this.lumber);
setplayerprop #c,You sold #v(this.lumber) logs;
lumber = strtofloat(#s(lumber))=0;
}



// Created By Rob Getashu
if (created) {
showcharacter;
setcharani appletree4,
}
if (actionlumberjacking && this.lumberhit<=100){
this.lumberhit++;
message #v(this.lumberhit/100*100)%
}
if (this.lumberhit=20) {
setcharani appletreecut,
}
if (this.lumberhit=100) {
setstring lumber,#v(strtofloat(#s(lumber))+3);
setani lumber,;
sleep .5;
hide;
say2
Wow this is valueable #b
lumber!#b
You now have #s(lumber).;
this.lumberhit=0
}

entravial 10-09-2001 07:38 AM

~AlphaFlame~

You're missing a ) in there in one place... and I'm to tired to point out/find anything more...

btedji 10-09-2001 07:42 AM

heres what the character guy should be:

NPC Code:

if (playerchats&&strequals(#c,sell lumber)) {
players[0].rupees+=strtofloat(#s(client.lumber);
setstring client.lumber,;
setstring server.gavelumber,strtofloat(#s(client.lumber); setplayerprop #c,You sold #s(client.lumber) logs.;
}




you use #s for strings, you dont need to use this.lumber, what was that last line for anyway, you should use players[0].rupees

ill work on the other one soon

SSRobgeta 10-10-2001 02:36 AM

thanks

Link188 10-10-2001 02:44 AM

There now finish the Lumberjacking and send it to me! Thank you by the way guys!

SSRobgeta 10-10-2001 02:46 AM

Quote:

Originally posted by Link188
There now finish the Lumberjacking and send it to me! Thank you by the way guys!
It mine and whats with you adn the ^_^ all the time!

btedji 10-10-2001 06:56 AM

to me it looks like the tree cutting part would work just the way it is


All times are GMT +2. The time now is 11:49 AM.

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