Forum

> > CS2D > Scripts > I need help !
Forums overviewCS2D overview Scripts overviewLog in to reply

English I need help !

3 replies
To the start Previous 1 Next To the start

old I need help !

Egoist
User Off Offline

Quote
OK I want to make a npc that makes wizard armor(I added wizard armor)it takes 15000$ and 5 wizard books from you(I added wizard book too)and gives you a wizard armour can you code this ? this is my lua but it is wrong:

Spoiler >
edited 3×, last 14.04.11 06:42:38 pm

old Re: I need help !

DannyDeth
User Off Offline

Quote
Yay! One more idiot the forgot to close his functions and/or statements/loops with end!

Look, considering you are ( obviously ) not very bright, I will put this simply.
Look at this:
1
2
3
function my_function(argument)
	print(argument)
end
See how the function called 'my_function' has an 'end' to it? It's the same for this:
1
2
3
4
5
function my_function(agrument)
	if argument="print" then
		print(argument)
	end
end
Simple, is it not?

old Re: I need help !

SDKey
User Off Offline

Quote
Hi, TheFire1

With TAB it look so:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
-- WHERE BEGIN OF CODE?


			NPCs[18].func = function(npc, id, words, state)
				if words == "hi" then
					NPCspeak(npc, "Welcome! Are you want to sail somewhere ?")
					PLAYERS[id].tmp.npcstate = {npc, 1}
				end
			end
		end
	end
elseif state == 1 then
	if words=="no" then
		NPCspeak(npc, "Bye then.")
		PLAYERS[id].tmp.npcstate = {npc, 0}
	elseif words == "yes" then
	

-- WHERE FINISH  OF CODE?

It is your problem!!!

old Re: I need help !

Egoist
User Off Offline

Quote
Can you make a npc for me that makes wizard armor for 15000$ and a wizard book(I added wizard book)
edited 1×, last 14.04.11 06:43:26 pm
To the start Previous 1 Next To the start
Log in to reply Scripts overviewCS2D overviewForums overview