Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   NPC Scripting (https://forums.graalonline.com/forums/forumdisplay.php?f=8)
-   -   Hey, How could I akea shop? (https://forums.graalonline.com/forums/showthread.php?t=13958)

Jimboo 10-06-2001 09:34 PM

Hey, How could I akea shop?
 
yu knw with asic stuff like bombs,arrows,life, and other stuff? Is there anyway for me to have the omney when someone bys something?

Esiah 10-06-2001 10:27 PM

Your sig: That's not the exact quote but close enuf :)

anyways, if you want 99 bombs to be liek 50g, you put something liek..

if (playersays(buy bombs)) {
if (playerrupees>=50) {
playerrupees-=50;
playerbombs==99;
say2 Thanks for your purchase! Come again!;
}
}

or something liek that. :) Same with arrows, except replace bombs with darts :p

Slaktmaster 10-06-2001 10:54 PM

DO NOT USE PLAYERSAYS BECAUSE PLAYERSAYS IS DUMBER THAN THE FLASH MOVIE VERMAIN POSTED IN THE NOT GRAAL RELATED THREADS FORUM, THREAD NAME "Damage your brain here.".

LiquidIce00 10-06-2001 11:02 PM

Quote:

Originally posted by Slaktmaster
DO NOT USE PLAYERSAYS BECAUSE PLAYERSAYS IS DUMBER THAN THE FLASH MOVIE VERMAIN POSTED IN THE NOT GRAAL RELATED THREADS FORUM, THREAD NAME "Damage your brain here.".
only if ur making a p2p server you mean

freddyfox 10-06-2001 11:18 PM

playersays is alright if you're doing a non-P2P server, but only if you put a setplayerprop #c after it. Otherwise, the operations will repeat themselves, and the player will find themselves out of money.

Jimboo 10-06-2001 11:25 PM

re:
 
but will that give ME money, or just take away player money?

freddyfox 10-06-2001 11:34 PM

Re: re:
 
Quote:

Originally posted by Jimboo
but will that give ME money, or just take away player money?
It'll just take away player money.

btedji 10-07-2001 02:22 AM

do this, its better

NPC Code:

if(playerchats&&strequals(#c,buy bombs)&&players[0].rupees>49)
{players[0].rupees-=50;
players[0].bombs=99;
}




btw: == compares, = assigns

entravial 10-07-2001 02:54 AM

~AlphaFlame~

And everyone is forgetting that he wants the players money to go to him...

oscarjf1 10-07-2001 03:35 AM

im here to save the day, lol
 
okay, here should be the complete script:

[code]
// This is where a player buys the bomb
if (strequals(#c,buy bombs)) {
if (playerrupees>=50) {mymoney+=50; playerrupees-=50;
}
setplayerprop #c,;
}
// This is where you take the money by saying "pay me punk"
if (strequals(#a,<your account name here>)) {
if (strequals(#c,pay me punk)) {playerrupees+=mymoney; mymoney=0;
}
}

You could automatically have the server add the money to you, with p2p NPCserver commands, but this way is more simple, and can be used on a non-p2p server ;).


All times are GMT +2. The time now is 06:54 AM.

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