Search
 
 

Display results as :
 

 


Rechercher Advanced Search

Keywords

Latest topics
» Bus School Application to be VIP
10/7/2015, 9:22 pm by Bus School

» The main forum has been moved
21/6/2015, 10:38 pm by Anonymous :D

» Application to be mod on saz server
28/3/2015, 7:33 pm by Anonymous :D

» Aplication mod
6/2/2015, 8:12 am by Ajmin

» Refurbishing the forum
4/2/2015, 6:44 pm by ZxC

» Ban appeals request
4/2/2015, 6:32 pm by ZxC

» Suggesting ideas
4/2/2015, 6:23 pm by ZxC

» Rule violation and banning
4/2/2015, 6:01 pm by ZxC

» Server Rules
4/2/2015, 5:57 pm by ZxC

November 2017
MonTueWedThuFriSatSun
  12345
6789101112
13141516171819
20212223242526
27282930   

Calendar Calendar


How to make Lua scripting?

View previous topic View next topic Go down

How to make Lua scripting?

Post by ZxC on 12/9/2014, 11:41 am

!!!READ THE THREAD FIRST!!!

Hi all! Very Happy

In this thread i will show the learning "how to script using Lua".

In general i am not a scripter nor i am good at scripting but i can show some tutorials borrowed.

Now let's start.
--------------------------------------------------------------

Lua

Everyone knows what is lua right?

Lua-Lua is a program language that is written in C.

In general this word "Lua" is in portughese language and that mean "moon".

Also the logo can speak itself is a moon.



----------------------------------------------------------------

2-Definitions of parameter

Here i will put some definitions of some parameters.

Variables-This parameter is the most important thing in the lua programming.

Here i will put an example of a variable:

Code:
My box=The content of the box

Now you understand the function of the variable right?

Also there are many functions and hooks but you can see more in the link --->Lua scripting

Just scroll down and you will see the hooks and the functions.

----------------------------------------------------------------

3-Tools for scripting

Here i will put some two tools that are useful for lua scripting.

Notepad++
SciTE

---------------------------------------------------------------

3-Some tutorials

Here i will put some tutorials that may be useful for you. Smile

Lua scripting
Learning the lua in hard way #1
Learning the lua in hard way #2
Lua 5.1 Reference Manual
---------------------------------------------------------------
4-Samples of CS2D, hooks and lua commands

CS2D Hooks
CS2D Lua commands

Samples- The samples can be useful, so to find the samples of CS2D, you must go to CS2D directory/sys/lua/samples and here you can find some samples.

-----------------------------------------------------------------

And that it. Very Happy

To learn and understand the lua scripting, you must practicing more and requie more logic for that.

It will be very hard at the start, but it will be easy when you understand.

Cheers and regards,
ZxC Cool
avatar
ZxC
Owner
Owner

Posts : 655
Thanks : 0
Join date : 2014-08-20
Location : Italy

Back to top Go down

Re: How to make Lua scripting?

Post by Guest on 12/9/2014, 12:05 pm

FOR NEWBIE players this make their mind more complex by reading tutorial
i will suggest to all beginners to learn lua by seeing other script like me.
i learnt lua by seeing other scripts. its the best way.
after getting an idea about lua then see tutorials cuz it will make u understand.

IF a beginner is seeing a lua tutorial his mind will just say : "OHH WHATS thissss".

and also this scripting tool helps u a lot at scripting.
this is made by the iran town coder.
Attachments
Nouveau Archive WinRAR ZIP (2).zip IRAN TOWN SERVER.lua extension(541 Kb) Downloaded 6 times

Guest
Guest


Back to top Go down

Re: How to make Lua scripting?

Post by ZxC on 12/9/2014, 12:17 pm

@Ajmin wrote:FOR NEWBIE players this make their mind more complex by reading tutorial
i will suggest to all beginners to learn lua by seeing other script like me.
i learnt lua by seeing other scripts. its the best way.
after getting an idea about lua then see tutorials cuz it will make u understand.

IF a beginner is seeing a lua tutorial his mind will just say : "OHH WHATS thissss".

and also this scripting tool helps u a lot at scripting.
this is made by the iran town coder.

Nice tool. Very Happy

However learning lua scripting is more better.

I don't mean this tool is not useful, but learning the coding in lua it will be more better.

But thanks for that tool, is useful. Smile
avatar
ZxC
Owner
Owner

Posts : 655
Thanks : 0
Join date : 2014-08-20
Location : Italy

Back to top Go down

Re: How to make Lua scripting?

Post by Anonymous :D on 12/9/2014, 12:45 pm

you have iran town lua?
avatar
Anonymous :D
Owner
Owner

Posts : 1119
Thanks : 8
Join date : 2011-12-09

http://saz-clan.tk/

Back to top Go down

Re: How to make Lua scripting?

Post by ZxC on 12/9/2014, 2:41 pm

dice wrote:you have iran town lua?

I saw in Unreal Software File Archive section, the iran town editor is deleted and there will not be iran town editor anymore.

But i see Ajmin still keep this file in his computer. Smile
avatar
ZxC
Owner
Owner

Posts : 655
Thanks : 0
Join date : 2014-08-20
Location : Italy

Back to top Go down

Re: How to make Lua scripting?

Post by Anonymous :D on 12/9/2014, 3:01 pm

ok Very Happy
avatar
Anonymous :D
Owner
Owner

Posts : 1119
Thanks : 8
Join date : 2011-12-09

http://saz-clan.tk/

Back to top Go down

Re: How to make Lua scripting?

Post by J+ on 12/9/2014, 3:37 pm

In CS2D you need to combination lua with hook from CS2D, Example with join hook:
Code:
addhook("join","joinxpl") --- hook join
function joinxpl(id) --- function of hook join
-- msg2(id,"Welcome "..player(id,"name"))
end --- this is for "function joinxpl(id)"

also, you can get more hook at www.cs2d.com
avatar
J+
Scripter
Scripter

Posts : 44
Thanks : 0
Join date : 2013-09-12
Age : 19
Location : Joni village in SAZ clan

Back to top Go down

Re: How to make Lua scripting?

Post by Guest on 13/9/2014, 12:53 pm

also u need to make ends for if and for.
mainly for functions

Guest
Guest


Back to top Go down

Re: How to make Lua scripting?

Post by ZxC on 13/9/2014, 12:57 pm

@Ajmin wrote:also u need to make ends for if and for.
mainly for functions

I know that parameter.

The "end" is used for ending the lua (i don't mean it will not work the functionality of lua).

Also the "parse" parameter i know is a parameter that put a action by the game i think. :/

For example:

Code:
parse "/kill"
avatar
ZxC
Owner
Owner

Posts : 655
Thanks : 0
Join date : 2014-08-20
Location : Italy

Back to top Go down

Re: How to make Lua scripting?

Post by Guest on 13/9/2014, 7:54 pm

nono

parse used for rcon commands notconsole commands and u dont want to use /kill just use kill.
but kill is a console cmd not rcon cmd.
so u can use killplayer instead of kill.

rcon cmd's can be only executed by users who know rcon.

console cmds is common like anyone can use it in gameplay.

correct one:
parse("killplayer 1")
wrong one:
parse("/killplayer 1")

Guest
Guest


Back to top Go down

Re: How to make Lua scripting?

Post by ZxC on 13/9/2014, 7:58 pm

@Ajmin wrote:nono

parse used for rcon commands notconsole commands and u dont want to use /kill just use kill.
but kill is a console cmd not rcon cmd.
so u can use killplayer instead of kill.

rcon cmd's can be only executed by users who know rcon.

console cmds is common like anyone can use it in gameplay.

correct one:
parse("killplayer 1")
wrong one:
parse("/killplayer 1")

Yes sir, i understood.

You are good at lua than me. -.-

You deserve a big ice cream. Very Happy

Because i'm sure in Saudi Arabia is so hot.
avatar
ZxC
Owner
Owner

Posts : 655
Thanks : 0
Join date : 2014-08-20
Location : Italy

Back to top Go down

Re: How to make Lua scripting?

Post by Sponsored content


Sponsored content


Back to top Go down

View previous topic View next topic Back to top

- Similar topics

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