Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   NPC Scripting (https://forums.graalonline.com/forums/forumdisplay.php?f=8)
-   -   Read This Plz (A Scripting Question) (https://forums.graalonline.com/forums/showthread.php?t=13492)

Vinvect 10-01-2001 05:20 AM

Read This Plz (A Scripting Question)
 
How do i do somethin like if i touch a Ball
then if i touch another ball then i go to this house then i say Sell Balls then u get money?
or if u dont get me,
its just like pearl diving like i touch a peral then i go sell them.
but im asking, how do i do the thingy where when i touch the ball then it adds +1 then i touch another ball then it adds +1 again anthen i go to a person who nuys balls then you say sell balls the nu get money corresponding how many balls u get.:grrr:

ownerofbabylon 10-01-2001 05:40 AM

well make a string and and each time the player touchs a NPC it hides and adds one to the string

ownerofbabylon 10-01-2001 05:45 AM

so somthing like this:

if(playerenters){
setstring balls,0;
}

then in the balls:

if(playertouchsme){
balls = balls + 1;
}

then to sell make a NPC like:

if(playerchats&&(#c,sell balls)){
playerrupees = playerrupees + balls * 2; //to get 2 g for 1 ball
setstring balls,0;
}

just try somthing like that. Im not sure if i did all of it right but thats just off the top of my head

Vinvect 10-01-2001 06:02 AM

and
 
and how do i show something like this as a number:
client.bombs

Poogle 10-01-2001 06:58 AM

Quote:

Originally posted by ownerofbabylon
so somthing like this:

if(playerenters){
setstring balls,0;
}

then in the balls:

if(playertouchsme){
balls = balls + 1;
}

then to sell make a NPC like:

if(playerchats&&(#c,sell balls)){
playerrupees = playerrupees + balls * 2; //to get 2 g for 1 ball
setstring balls,0;
}

just try somthing like that. Im not sure if i did all of it right but thats just off the top of my head

LOL SELL BALLS

ownerofbabylon 10-01-2001 07:15 AM

Quote:

Originally posted by Poogle

LOL SELL BALLS

That wasnt funny

ownerofbabylon 10-01-2001 07:16 AM

Re: and
 
Quote:

Originally posted by Vinvect
and how do i show something like this as a number:
client.bombs

explain what u mean

Vinvect 10-01-2001 08:00 AM

i mean leik
a weapon that shows howmany bombs/balls you have
then when u fire it, it says (say2) leik this
say2 You Have (NUMBER) Balls/Bombs.
e.g/i.e
You Have 9 Balls/Bombs
:D

btedji 10-01-2001 08:35 AM

Quote:

Originally posted by Vinvect
i mean leik
a weapon that shows howmany bombs/balls you have
then when u fire it, it says (say2) leik this
say2 You Have (NUMBER) Balls/Bombs.
e.g/i.e
You Have 9 Balls/Bombs
:D

say2 You have #v(balls) balls/bombs.

you should use a string for the number of balls so it will save even after the player logs off.

Shard_IceFire 10-01-2001 08:35 AM

:p *looks down* well I have 2 balls but here is what you could do:
NPC Code:

//Code by Shard IceFire
if (playertouchsme) {
toweapons Ball count;
}
if (weaponfired) {
say2 You have #s(client.balls) balls!;
}


btedji 10-01-2001 09:05 AM

Quote:

Originally posted by Shard_IceFire
:p *looks down* well I have 2 balls but here is what you could do:
NPC Code:

//Code by Shard IceFire
if (playertouchsme) {
toweapons Ball count;
}
if (weaponfired) {
say2 You have #s(client.balls) balls!;
}


thats about as perfect as it gets

Vinvect 10-01-2001 09:06 AM

how do i use strings and how do i put it?

Shard_IceFire 10-01-2001 09:12 AM

Quote:

how do i use strings and how do i put it?
How do you put what?

btedji 10-01-2001 09:14 AM

some script for a ball npc

NPC Code:

if(playertouchsme)
{
setstring client.balls,strtofloat(#s(client.balls))+1;
}


Shard_IceFire 10-01-2001 09:36 AM

Quote:

if(playertouchsme)
{
setstring client.balls,strtofloat(#s(client.balls))+1;
}
that probably wouldn't work. If you did that, I believe it would set the string client.balls to +1. What you COULD do is:
NPC Code:

if(playertouchsme) {
this.ballplus=1+strtofloat(#s(client.balls));
setstring client.balls,#v(this.ballplus);
}


Don't get mad at me if I'm wrong but I'm pretty sure that what I said is correct.

btedji 10-01-2001 09:41 AM

Quote:

Originally posted by Shard_IceFire

that probably wouldn't work. If you did that, I believe it would set the string client.balls to +1. What you COULD do is:
NPC Code:

if(playertouchsme) {
this.ballplus=1+strtofloat(#s(client.balls));
setstring client.balls,#v(this.ballplus);
}


Don't get mad at me if I'm wrong but I'm pretty sure that what I said is correct.

change that to
NPC Code:

if(playertouchsme) {
setstring client.balls,#v(1+strtofloat(#s(client.balls)));
}


its shorter

Shard_IceFire 10-01-2001 09:46 AM

Does that even work? If it does it's not that much shorter...oh well.

btedji 10-01-2001 09:46 AM

i just like scripting it that way

fireball_dolphonia 10-02-2001 02:29 AM

if (playersays(sell balls))balls = balls - (#v(balls);
why wont it take away the balls that u had?

fireball_dolphonia 10-02-2001 02:32 AM

i made a ball system here it goes
// NPC made by Fireball
if (playerenters) {toweapons *Ball System;
}
if (playertouchsme) {
}
if(playersays(Show Balls))
say2 You have #v(balls) balls;
if(playersays(sell balls)){
playerrupees = playerrupees + balls * 2;
//to get 2 g for 1 ball
setstring balls,0;
balls = balls - (#v,balls);
}

btedji 10-02-2001 03:15 AM

Quote:

Originally posted by fireball_dolphonia
i made a ball system here it goes
// NPC made by Fireball
if (playerenters) {toweapons *Ball System;
}
if (playertouchsme) {
}
if(playersays(Show Balls))
say2 You have #v(balls) balls;
if(playersays(sell balls)){
playerrupees = playerrupees + balls * 2;
//to get 2 g for 1 ball
setstring balls,0;
balls = balls - (#v,balls);
}

uhh, that wont work well, so heres a better one:

NPC Code:

if (playerenters) {toweapons *Ball System;}

if(strequals(#c,Show Balls)&&playerchats)
{say2 You have #s(client.balls) balls.; }

if(strequals(#c,Sell Balls)&&playerchats){
players[0].rupees+=#v(strtofloat(#s(client.balls))*2);
//to get 2 g for 1 ball

setstring client.balls,0;
}



this is a better way of doing it

Vinvect 10-02-2001 06:30 AM

Quote:

Originally posted by Poogle

LOL SELL BALLS

STFU :spam:

ZORG1986 10-02-2001 06:53 AM

God damn lots of people all talking about each others balls, im starting to think ive gone to the wrong forum.....

SSj_Link 10-02-2001 07:09 AM

if (playersays(Plays With Balls)) {
say2 SICK PERSON;
setlevel2jail.graal,x,y;
}

lol


but seriously,
if (playersays(Sell Balls)) {
ball string =0;
}


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

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