Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   NPC Scripting (https://forums.graalonline.com/forums/forumdisplay.php?f=8)
-   -   A nifty little script I finally made (Shaun) (https://forums.graalonline.com/forums/showthread.php?t=7930)

richard 07-23-2001 10:38 PM

A nifty little script I finally made (Shaun)
 
<Shaun>

Hehe, I don't usually try to script anything complex or with more than 5 commands, but, I've made a nifty little script, well, it's actually two, acting together. One is a sign, the other is a door. When you touch the sign, it says
House for sale, 1000 Rupees
Say
Buy House 1
If you have the money, you can buy the house and then it sets a whole ton of things so only the account name of the person who buys the house can lock or unlock the door, and it says what their name was at the time they bought the house on the sign whenever a player touches it. There is a lot of say2 in there. It's also easy to put on other houses nearby, just changing the Buy House 1 to Buy House 2 and server.house1-1 to server.house2-1. I am not going to put up the script, but I would like to thank Tyhm for helping me with how to set server.house, I thought it was like flags, but he showed me how it's done, thank you Tyhm. I know to some of you it's not impressive at all, but those who know as much as me would appreciate it.

</Shaun>

ownerofbabylon 07-23-2001 11:04 PM

hmm not bad =D

grim_squeaker_x 07-23-2001 11:08 PM

Hmm?
NPC Code:
//Door
if (playerenters) timereverywhere;
if (created) this.id=0;
if (playertouchsme) {
if (strlen(#s(server.house#v(this.id)owner))>0) {
if (strequals(#a,#s(server.house#v(this.id)owner))||s erver.house#v(this.id)open) {
hidelocal;
dontblocklocal;
timeout=2;
}
else say2 This house is owned by#b#s(server.house#v(this.id)owner);
}
else {
hidelocal;
dontblocklocal;
timeout=2;
}
}
if (playerchats) {
if (strlen(#s(server.house#v(this.id)owner))<=0)
if (strequals(#c,Buy house #v(this.id))) {
if (playerrupees>=1000) {
playerrupees-=1000;
setstring server.house#v(this.id)owner,#a;
}
else say2 You don't have enough money!;
}
}
else if (strequals(#a,#s(server.house#v(this.id)owner))) {
if (strequals(#c,Sell house #v(this.id))) {
playerrupees+=500;
setstring server.house#v(this.id)owner,;
}
if (strequals(#c,Open house #v(this.id))) set server.house#v(this.id)open;
if (strequals(#c,Close house #v(this.id))) unset server.house#v(this.id)open;
}
}


NPC Code:
//Sign
if (created) this.id=0;
if (playertouchsme) {
if (strlen(#s(server.house#v(this.id)owner))<=0) say2 House for sale!#b-1000 Gralats#bSay "buy house #v(this.id)";
else say2 House owned by#b#s(server.house#v(this.id)owner));
}


LiquidIce00 07-24-2001 06:54 AM

dam* girl you have too much free time.

richard 07-24-2001 08:33 AM

(Shaun)
 
<Shaun>

Pft, you try to hard, it's at least half the size.

</Shaun>

Knightoffrost 07-24-2001 08:38 AM

Re: A nifty little script I finally made (Shaun)
 
Quote:

Originally posted by richard
<Shaun>

Hehe, I don't usually try to script anything complex or with more than 5 commands, but, I've made a nifty little script, well, it's actually two, acting together. One is a sign, the other is a door. When you touch the sign, it says
House for sale, 1000 Rupees
Say
Buy House 1
If you have the money, you can buy the house and then it sets a whole ton of things so only the account name of the person who buys the house can lock or unlock the door, and it says what their name was at the time they bought the house on the sign whenever a player touches it. There is a lot of say2 in there. It's also easy to put on other houses nearby, just changing the Buy House 1 to Buy House 2 and server.house1-1 to server.house2-1. I am not going to put up the script, but I would like to thank Tyhm for helping me with how to set server.house, I thought it was like flags, but he showed me how it's done, thank you Tyhm. I know to some of you it's not impressive at all, but those who know as much as me would appreciate it.

</Shaun>

People dont usually care about scripts unless someone wants an opinion,help or they actually post the damn script

Hulk Hogan 07-24-2001 12:14 PM

Re: (Shaun)
 
Quote:

Originally posted by richard
<Shaun>

Pft, you try to hard, it's at least half the size.

</Shaun>

But is yours bugged?
Maybe hers has no bugs whats so ever adn yours does....
you never know ;)

07-25-2001 09:05 AM

Quote:

Originally posted by grim_squeaker_x
Hmm?
NPC Code:
//Door
if (playerenters) timereverywhere;
if (created) this.id=0;
if (playertouchsme) {
if (strlen(#s(server.house#v(this.id)owner))>0) {
if (strequals(#a,#s(server.house#v(this.id)owner))||s erver.house#v(this.id)open) {
hidelocal;
dontblocklocal;
timeout=2;
}
else say2 This house is owned by#b#s(server.house#v(this.id)owner);
}
else {
hidelocal;
dontblocklocal;
timeout=2;
}
}
if (playerchats) {
if (strlen(#s(server.house#v(this.id)owner))<=0)
if (strequals(#c,Buy house #v(this.id))) {
if (playerrupees>=1000) {
playerrupees-=1000;
setstring server.house#v(this.id)owner,#a;
}
else say2 You don't have enough money!;
}
}
else if (strequals(#a,#s(server.house#v(this.id)owner))) {
if (strequals(#c,Sell house #v(this.id))) {
playerrupees+=500;
setstring server.house#v(this.id)owner,;
}
if (strequals(#c,Open house #v(this.id))) set server.house#v(this.id)open;
if (strequals(#c,Close house #v(this.id))) unset server.house#v(this.id)open;
}
}


NPC Code:
//Sign
if (created) this.id=0;
if (playertouchsme) {
if (strlen(#s(server.house#v(this.id)owner))<=0) say2 House for sale!#b-1000 Gralats#bSay "buy house #v(this.id)";
else say2 House owned by#b#s(server.house#v(this.id)owner));
}



Thats a nice script their but their will be a problem with it online. It will be laggy as hell!

richard 07-25-2001 10:19 AM

(Shaun)
 
<Shaun>

no, mine has no bugs, and I tested it online. My script is smaller, and so it has less lag. You added a ton of stuff not needed. It's like I am saying 1 x 5 = 5, while you're saying 1 + 1 + 1 + 1 + 1 = 5, but, well, it makes sense to me..

</Shaun>

richard 07-25-2001 10:22 AM

(Shaun)
 
<Shaun>

and I found an error in your script, set server.whatever doesn't work. You used that in there instead of setstring server.whatever,1;

</Shaun>

grim_squeaker_x 07-25-2001 04:27 PM

Quote:

Originally posted by IcePick_2001



Thats a nice script their but their will be a problem with it online. It will be laggy as hell!

Nope, it only runs if the player touches the door and/or if the player says something, which in turn results to no lag at all.

Shard_IceFire 07-25-2001 10:45 PM

Quote:

Nope, it only runs if the player touches the door and/or if the player says something, which in turn results to no lag at all.
ROFL! She's got ya there!

warped 08-01-2001 11:15 AM

>.<
 
o_O

I got lost from the 3 post down lol.
I am a .. Ok .. scripter.
How is the best way to learn how to
script really well and stuff like some
of you?
Oh yes i graal nick is Gazamune so some
of you may know me =)

Slaktmaster 08-01-2001 03:47 PM

Re: >.<
 
Quote:

Originally posted by warped
o_O

I got lost from the 3 post down lol.
I am a .. Ok .. scripter.
How is the best way to learn how to
script really well and stuff like some
of you?
Oh yes i graal nick is Gazamune so some
of you may know me =)

Uhh...hi?


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

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