Forum

> > Stranded II > Scripts > Automatic Spear Maker
Forums overviewStranded II overview Scripts overviewLog in to reply

English Automatic Spear Maker

3 replies
To the start Previous 1 Next To the start

old Automatic Spear Maker

Xephoriah
User Off Offline

Quote
im scripting the game to make an automatic spear maker, but i need some help, im using this command
1
2
3
local $id;
		$id=create("item",52);
			store $id,"unit",1;
but you need a stone and stick to make it. when use this item, it creates spears even without the stones and sticks. what other thing do i need to make it so it has to search for the ids of the sticks and stones so it can be used only when i have them in my inventory?

old Re: Automatic Spear Maker

Hurri04
Super User Off Offline

Quote
actually it's like this:
1
2
3
4
if((playergotitem([STICK_TYPE]) >= 1) && (playergotitem([STONE_TYPE]) >= 1)) {
	//your stuff goes here
	//...
}


@user Assassin moder: just a little hint: as a general rule, it has become custom in this forum to indicate values that have to be inserted with [] instead of {} because those second ones actually do something (open and close blocks of code).
[] will give you a distinct error message if you leave them in the code, I think. only on the command list page they have a different meaning, namely the value being an optional one.
To the start Previous 1 Next To the start
Log in to reply Scripts overviewStranded II overviewForums overview