|
Post by Crusader on Apr 23, 2014 8:39:56 GMT 5.5
Talk about Lua Scripting here A little lua tutoral www.cs2d.com/tut/tkdlua/luatut.html CS2D Tutorial Copyright by TheKilledDeath Richard Baumann You can also ask quetions here and I hope some1 can answer it
|
|
|
Post by Crusader on May 19, 2014 17:09:24 GMT 5.5
--Nevermind, using other not reseted hats with easy configureable
|
|
|
Post by chikitokun on May 27, 2014 0:23:19 GMT 5.5
hmm... i wonder,can anyone make an example of command "if" on lua plugin??the only thing i understand is addhook D:
|
|
|
Post by Crusader on May 27, 2014 6:38:47 GMT 5.5
If you understand addhook, why not understand if Example addhook("say","testing") function testing(id,text) if id == 1 then if text == "Hello, RR!" then msg("Player with id 1 say "..text) return 1 end end end
Explanation, each line 1 -- say is special hook as you know, and testing is hook name 2 -- for function of add hook we cant change it as we want, because everytime we say there will [Crusader(id) : Blablabla(txt)] | see cs2d.com on help category to see any parameter 3 -- If player who say have id 1 then, also for comparison must use == not =, also dont forget then 4 -- if the message is "Hello, RR!" <- must use " 5 -- msg, a lua command on cs2d, also "..text is to concatenate string with whatever 6 -- Return 1, in addhook say it mean dont show the real command/message [the real "Hello, RR!" message] 7 -- If text == "Hello, RR!" stopped here 8 -- If id == 1 is stopped here9 -- Function of testing is ended here
|
|
|
Post by Bounty Hunter on Oct 3, 2014 13:32:49 GMT 5.5
At these days I'm scripting classmod for my clan. Lua's not easy!
|
|
|
Post by Electric on Oct 3, 2014 13:59:57 GMT 5.5
I have tried to make many times its very hard
|
|
|
Post by Bounty Hunter on Oct 3, 2014 14:13:51 GMT 5.5
You mean it's hard to modify and make classmod? It's not really hard, for example:
function sample.classes.classmenu(id) menu(id,"Select Your Class,DaNgEr# Terrorist") end
addhook("spawn","sample.classes.spawn") function sample.classes.spawn(id) -- DaNgEr# Terrorist if (sample.classes.class[id]==1) then msg2(id,"©000255150» You are DaNgEr# Terrorist. «") parse ("setmaxhealth "..id.." 120") parse ("setarmor "..id.." 100") parse ("speedmod "..id.." 2") return "79,30,53"; end
|
|
|
Post by subzero on Oct 3, 2014 23:41:33 GMT 5.5
Lua for me is EXTREMELY HARD!!! I'm really good at mapping though.
|
|