Been trying to convert this shovel written in Gs2 back to Gs1. So far it hasnt been working :whatever:. I guess the easiest way to do this is to post the script, and have you more knowledgable scripters out there take a look and see if you can spot whats making it not work?
To be honest I can’t quite remember where I found this script. I know it’s off Agret’s DVD…I’m thinking Classic 06’. Anyways…
Shovel NPC:
//#CLIENTSIDE
if (weaponfired) {
{
this.tiles ={
2176,
2177,
2192,
2193
};
setani shovel,;
freezeplayer 1;
sleep 0.5;
ar = {playerx + (vecx(playerdir) * 2) + 1.1,
playery + (vecy(playerdir) * 2) + 1.1};
showimg 2001,"@Courier New@b@+", ar[0], ar[1];
if (tiles[ar[0],ar[1]] == 2240){
this.num = int(random(1,9));
if (this.num == 4){
setplayerprop#c,;
if (params[0] == "dirt"){
ar = {playerx + (vecx(playerdir) * 2) + 1.1,
playery + (vecy(playerdir) * 2) + 1.1};
putnpc ar[0],ar[1],"join digitems;";
temp.num = int(random(1,4));
temp.owner = #a;
with(npcs[npcs.size()-1]) {
this.num = temp.num;
this.owner = temp.owner;
}
}
}
if (tiles[ar[0],ar[1]] in this.tiles){
this.num = int(random(1,9));
if (this.num == 4){
setplayerprop#c,;
if (params[0] == "grass"){
ar = {playerx + (vecx(playerdir) * 2) + 1.1,
playery + (vecy(playerdir) * 2) + 1.1};
putnpc2(ar[0], ar[1], "join digitems;");
temp.num = 4;
temp.owner = #a;
with(npcs[npcs.size()-1]) {
this.num = temp.num;
this.owner = temp.owner;
}
}
}
}
}
sleep 0.5;
setani idle,;
hideimg 2001;
}
}
digitems class:
[CODE]if (created) {
this.numb = int(random(1,6));
this.time = 30;
setshape 1,32,32;
if (this.num == 1){
message SeaShell1;
setimg block.png;
}
if (this.num == 2){
message SeaShell2;
setimg block.png;
}
if (this.num == 3){
message SeaShell3;
setimg block.png;
}
if (this.num == 4){
message Money - @this.numb;
setimg block.png;
}
timeout = 1;
}
if (playertouchsme) {
if (#a == this.owner || this.time == 0){
if (this.num == 1){
client.seashell1 +=1;
destroy;
}
if (this.num == 2){
client.seashell2 +=1;
destroy;
}
if (this.num == 3){
client.seashell3 +=1;
destroy;
}
if (this.num == 4){
playerrupees +=this.numb;
destroy;
}
}
}
if (timeout) {
if (this.time != 0){
this.time -=1;
}
timeout = 1;
}
[/CODE]