Similar topics
Search
Latest topics
[Tutorial] How to begin lua scripting.
3 posters
Page 1 of 1
[Tutorial] How to begin lua scripting.
Well, me and my friends started trying to lua script, we learned the basics. So we tried to find a Basics Tutorial for newcomers, and we checked if we understand the tutorial, we did so here is the Basics of Lua Scripting, if any of you need a Advanced guide, just reply.
http://www.cs2d.com/tut/tkdlua/luatut.html
http://www.cs2d.com/tut/tkdlua/luatut.html
http://www.cs2d.com/tut/tkdlua/luatut.html
http://www.cs2d.com/tut/tkdlua/luatut.html
http://www.cs2d.com/tut/tkdlua/luatut.html
http://www.cs2d.com/tut/tkdlua/luatut.html
http://www.cs2d.com/tut/tkdlua/luatut.html
http://www.cs2d.com/tut/tkdlua/luatut.html
http://www.cs2d.com/tut/tkdlua/luatut.html
http://www.cs2d.com/tut/tkdlua/luatut.html
WhiteWolf- Posts : 226
Rep : 12
Join date : 2010-06-11
Re: [Tutorial] How to begin lua scripting.
these tutorials are a great way to learn lua scripting. well for beginners like me they are great.
V1Kt0R- Posts : 196
Rep : 2
Join date : 2010-06-19
Age : 29
Location : Auburn
Re: [Tutorial] How to begin lua scripting.
V1Kt0R wrote:these tutorials are a great way to learn lua scripting. well for beginners like me they are great.
Glad it was good for you big bro.
WhiteWolf- Posts : 226
Rep : 12
Join date : 2010-06-11
Re: [Tutorial] How to begin lua scripting.
You can get info about lua scripting at.
sys/lua/info.txt or http://www.lua.org/manual/5.1/
Some hooks need functions and parameters..
The hook.
The function. (This hook will call the function)
How to use command in console using lua scripts.
If you wanna make people get items at spawn you can do this.
And the player will get a laser.
The strings functions allow you to add more words in the same string.
sys/lua/info.txt or http://www.lua.org/manual/5.1/
Some hooks need functions and parameters..
The hook.
- Code:
addhook("spawn","my_lua_hook_spawn")
The function. (This hook will call the function)
- Code:
function my_lua_hook_spawn(id)
-- Here you can do what you want like use commands.
end
How to use command in console using lua scripts.
- Code:
parse("command")
If you wanna make people get items at spawn you can do this.
- Code:
function my_lua_hook_spawn(id)
parse("equip "..id.." 45")
end
And the player will get a laser.
The strings functions allow you to add more words in the same string.
- Code:
mytable = {"I","am","testing","this","string","function"}
function table.join(t,j)
if not j then j = " " end
local new_string = ""
if type(t) == "table" then
for _, word in pairs(t) do
new_string = new_string .. j .. word
end
end
return new_string
end
my_string = table.join(mytable)
msg(my_string)
Starkkz- Posts : 30
Rep : 0
Join date : 2010-06-11
Page 1 of 1
Permissions in this forum:
You cannot reply to topics in this forum
Fri Sep 09, 2011 4:58 pm by WhiteWolf
» Last to post wins
Fri Sep 09, 2011 4:57 pm by WhiteWolf
» COMBAT ARMS WOOOOO
Tue Oct 19, 2010 10:59 pm by viperjake31
» Its over (Bye)
Wed Sep 22, 2010 10:05 pm by Supanooba
» Sorry guys...
Wed Sep 22, 2010 10:01 pm by Supanooba
» bad feeling...
Tue Sep 21, 2010 1:16 pm by Supanooba
» This game...
Sun Sep 19, 2010 10:01 am by Supanooba
» Me, D@rk T3mpl4r, Hacking?
Sun Sep 19, 2010 12:36 am by D@rk T3mpl4r
» fractured my arm and leg
Sat Sep 18, 2010 9:08 pm by Supanooba