Forum

> > Stranded II > General > Scripting problem
Forums overviewStranded II overviewGeneral overviewLog in to reply

English Scripting problem

2 replies
To the start Previous 1 Next To the start

old closed Scripting problem

Guest

Quote
Hi,
I have been trying to implement a cooking skill so with a certain level of cooking you are able to bake bread. However, I am rather new to scripting and do not quite understand how it works. Below is the script of what i'm trying to do:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
### Paste
id=82
name=Dough
group=food
icon=gfx\paste.bmp
model=gfx\paste.b3d
scale=0.65
mat=dirt
weight=350
info=simple dough made of flour and water. I can use it close to fire in order to bake it
script=start
	//Bake!
	on:use {if (skillvalue("cooking")>=300){
		if ((count_inrange("state",5,50)+count_inrange("state",4,50))>0){
			fry;
			process "baking",1000;
			alteritem 1,44;
				event "iskill_cooking","global";
		}else{
			msg "I need fire to bake this!",3;
			speech "negative";
		}
	}
}else{
	speech "negative";
	msg "I cannot do this yet!",3;
	msg "My cooking skill needs to be higher!",3;
	}
	//Eat
	on:eat {
		process "eating",1000;
		eat 7,50,5,0;	
	}
script=end

When I tested it in game it said there is an "else{" or "elseif{" that is does not belong to anything. I am assuming it is the line:

1
2
3
4
5
}else{
	speech "negative";
	msg "I cannot do this yet!",3;
	msg "My cooking skill needs to be higher!",3;
	}

If someone would be able to correct me on what I am doing wrong so the script functions. It would be much appreciated.

Thanks.
To the start Previous 1 Next To the start
Log in to replyGeneral overviewStranded II overviewForums overview