Monolith Forums
Would you like to react to this message? Create an account in a few clicks or log in to continue.
Search
 
 

Display results as :
 


Rechercher Advanced Search

Latest topics
» Hey guys.........
[Tutorial] How to begin lua scripting. I_icon_minitimeFri Sep 09, 2011 4:58 pm by WhiteWolf

» Last to post wins
[Tutorial] How to begin lua scripting. I_icon_minitimeFri Sep 09, 2011 4:57 pm by WhiteWolf

» COMBAT ARMS WOOOOO
[Tutorial] How to begin lua scripting. I_icon_minitimeTue Oct 19, 2010 10:59 pm by viperjake31

» Its over (Bye)
[Tutorial] How to begin lua scripting. I_icon_minitimeWed Sep 22, 2010 10:05 pm by Supanooba

» Sorry guys...
[Tutorial] How to begin lua scripting. I_icon_minitimeWed Sep 22, 2010 10:01 pm by Supanooba

» bad feeling...
[Tutorial] How to begin lua scripting. I_icon_minitimeTue Sep 21, 2010 1:16 pm by Supanooba

» This game...
[Tutorial] How to begin lua scripting. I_icon_minitimeSun Sep 19, 2010 10:01 am by Supanooba

» Me, D@rk T3mpl4r, Hacking?
[Tutorial] How to begin lua scripting. I_icon_minitimeSun Sep 19, 2010 12:36 am by D@rk T3mpl4r

» fractured my arm and leg
[Tutorial] How to begin lua scripting. I_icon_minitimeSat Sep 18, 2010 9:08 pm by Supanooba

Navigation
 Portal
 Index
 Memberlist
 Profile
 FAQ
 Search

[Tutorial] How to begin lua scripting.

3 posters

Go down

[Tutorial] How to begin lua scripting. Empty [Tutorial] How to begin lua scripting.

Post by WhiteWolf Tue Jul 06, 2010 11:43 am

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. bounce

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
WhiteWolf

Posts : 226
Rep : 12
Join date : 2010-06-11

Back to top Go down

[Tutorial] How to begin lua scripting. Empty Re: [Tutorial] How to begin lua scripting.

Post by V1Kt0R Fri Jul 09, 2010 3:03 pm

these tutorials are a great way to learn lua scripting. well for beginners like me they are great.
V1Kt0R
V1Kt0R

Posts : 196
Rep : 2
Join date : 2010-06-19
Age : 28
Location : Auburn

Back to top Go down

[Tutorial] How to begin lua scripting. Empty Re: [Tutorial] How to begin lua scripting.

Post by WhiteWolf Sat Jul 10, 2010 10:21 pm

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
WhiteWolf

Posts : 226
Rep : 12
Join date : 2010-06-11

Back to top Go down

[Tutorial] How to begin lua scripting. Empty Re: [Tutorial] How to begin lua scripting.

Post by Starkkz Sat Aug 07, 2010 10:08 pm

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.
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

Back to top Go down

[Tutorial] How to begin lua scripting. Empty Re: [Tutorial] How to begin lua scripting.

Post by Sponsored content


Sponsored content


Back to top Go down

Back to top


 
Permissions in this forum:
You cannot reply to topics in this forum