Game Guides > Game FAQ >  

How do you create a simple MTASA script

How do you create a simple MTASA script
You need to make a folder, and inside that make a meta.xml file. Open meta.xml in any text editor, i use Notepad++. Type/copy this into it.



<meta>
<info author="Me" type="misc" version="1.0" />
<script src="server.lua" type="server" />
</meta>


Now in the same folder make a server.lua file and open it in your text editor and type:


function iLikeMTASA(thePlayer, command, guy)
if guy then
outputChatBox(guy .. " likes to play MTA", getRootElement(), 255,0,0, false)
else
outputChatBox("I like to play MTA", getRootElement(), 255,0,0,false)
end

addCommandHandler("mtasa", iLikeMTASA)



Typing "mtasa" output's "Me likes to play MTA" typing "mtasa" output's "I like to play MTA"