Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   NPC Scripting (https://forums.graalonline.com/forums/forumdisplay.php?f=8)
-   -   making a shop (https://forums.graalonline.com/forums/showthread.php?t=62093)

SyLaTAC 11-05-2005 08:55 PM

making a shop
 
ok im making a pizza shop and i need to figure out how to make an item that will work online all i have for it like all that i know is

NPC Code:
if (playerchats && strequals(#c,buy single)) {
if (playerrupees <=7) {
message you dont have enough money;
}
if (playerrupees >=7){
message Thank you!;
}


} {



thats all i have because i cant figure out how to make it
1) an item that does stuff
2) go into your inventory and take gralats away

will someone help me please?

ZeLpH_MyStiK 11-05-2005 09:16 PM

read commands.rtf and npcprogramming.doc
plus use else as opposed to 2 if-statements

SyLaTAC 11-05-2005 09:18 PM

how do i use an else statement?

ZeLpH_MyStiK 11-05-2005 09:30 PM

NPC Code:

if ( boolean ) { // your everyday if-statement
// if the boolean is true, do stuff here
} else {
// if the boolean is not true, do stuff here
}


SyLaTAC 11-05-2005 09:43 PM

ahh ok thx

SyLaTAC 11-05-2005 10:04 PM

i cant figure out how to make it take rupees =(

Rick 11-05-2005 10:18 PM

You want to change the variable:

playerrupees = playerrupees - 7;

or

playerrupees -= 7;

SyLaTAC 11-05-2005 10:20 PM

thx! alot

SyLaTAC 11-05-2005 10:56 PM

ok uhm i need to make a weapon that heals you and then dissapears how would i do that?

NPC Code:
If (weaponfired) {playerhearts =playerhearts +1}


then what?

and how do i make it add a weapon to your inventory because i put the weapon in RC named it the same but when i buy it it doesnt add it X.x

ZeLpH_MyStiK 11-06-2005 01:03 AM

NPC Code:
destroy;



*I sense another excaliber*

haunter 11-06-2005 01:06 AM

Perhaps you should've learned a bit about scripting, and the other development areas in Graal before going ahead and wasting a hundred bucks on a server?

excaliber7388 11-06-2005 01:25 AM

Quote:

Originally Posted by SyLaTAC
ok uhm i need to make a weapon that heals you and then dissapears how would i do that?

NPC Code:
If (weaponfired) {playerhearts =playerhearts +1}


then what?

and how do i make it add a weapon to your inventory because i put the weapon in RC named it the same but when i buy it it doesnt add it X.x

I answered this question for you in one of your other threads
Quote:

Originally Posted by ZeLpH_MyStiK
*I sense another excaliber*

!pissed!
Oh common, i am SO not that bad. At least you can't fond the answers to my problems in the little box at the side of every NPC done offline

ZeLpH_MyStiK 11-06-2005 01:46 AM

Quote:

Originally Posted by excaliber7388
Oh common, i am SO not that bad. At least you can't fond the answers to my problems in the little box at the side of every NPC done offline

Nope, what you need is the little box of logic =D

Skyld 11-06-2005 01:57 AM

Quote:

Originally Posted by excaliber7388
!pissed!
Oh common, i am SO not that bad. At least you can't fond the answers to my problems in the little box at the side of every NPC done offline

What you need is a box of sense.

Codein 11-06-2005 02:09 AM

It might be worth tutoring him in the basics of GS2, because I dread to see that much money go to total waste, like I've seen before.

I doubt it'd take much effort, heck, I could do it.

excaliber7388 11-06-2005 02:30 AM

Quote:

Originally Posted by Skyld
What you need is a box of sense.

;*( stop picking on me! waaaaah ;)

SyLaTAC 11-07-2005 08:00 PM

X.x i didnt bu a server im a dev on another server...im not that stupid, i mean i pretty ggod at levels,graphics, and gani's , its just the scipting im litte rusty on so rather than diss on me it would be nicer if you helped me or directed me in the right direction..thats all i asked for, and thats kinda what this forum is for so please dont chastise me for no apparent reason....thanks....and codien thanks alot man i could really use yuor help in some things so yeah ill get ahold of jo0.

Knuckles 11-09-2005 08:53 AM

Quote:

Originally Posted by SyLaTAC
ok im making a pizza shop and i need to figure out how to make an item that will work online all i have for it like all that i know is

NPC Code:
if (playerchats && strequals(#c,buy single)) {
if (playerrupees <=7) {
message you dont have enough money;
}
if (playerrupees >=7){
message Thank you!;
}


} {



thats all i have because i cant figure out how to make it
1) an item that does stuff
2) go into your inventory and take gralats away

will someone help me please?

Basically what you're saying is, if the player rupees is 7, then it will do both functions. In this case, it will do the latest function in the script. However this isn't exactly correct. Be sure to use one or the other.

Think about what you did:
playerrupees >= 7 (less then OR EQUAL to seven) "not enough money"
playerrupees <= 7 (greater then OR EQUAL to seven) "sold"

How could it be both?

Just for future reference when you get to more complex scripting. I think you should get into a habbit to doing this correctly so that they always work out right.

prozac424242 11-12-2005 06:00 PM

If you are making this for an online server,
you will need to make the playerhearts and rupees
adjustments happen serverside.
Hint: use a triggeraction on the npc

Riot 11-12-2005 07:25 PM

Quote:

Originally Posted by prozac424242
If you are making this for an online server,
you will need to make the playerhearts and rupees
adjustments happen serverside.
Hint: use a triggeraction on the npc

or you can just do all of this serverside and not have any of it clientside.


All times are GMT +2. The time now is 01:43 AM.

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