Jump to content

Need help

Recommended Posts

here is an example

local gate1 = createObject(980,  2610.001953125, 1918.07421875, 11.0234375) --the gate pos 
local Status = "closed" 
function Gate1() 
    if (Status == "closed") then 
        moveObject(gate1, 2000,  2637.943359375, 1920.3759765625, 11.0234375, 0, 0, 0)-- this is when the gate close position 
        Status = "open" 
    elseif (Status == "open") then 
        moveObject(gate1, 2000, 2610.001953125, 1918.07421875, 11.0234375, 0, 0, 0)-- this is when gate open position 
        Status = "closed" 
addCommandHandler ("gate", Gate1) -- to open the gate 

Link to comment


Welcome to Multi Theft Auto, I hope you enjoy your stay here.

In order to learn to script in Lua scripting language, I suggest you take some time to find the following topic useful for yourself. It contains links to tutorials and information regarding the use of the language in practice. This is essential in order to learn the basics of Lua and then work on your Multi Theft Auto related scripts.

» Lua tutorials, manuals

After you have familiarized yourself with Lua and know how to deploy basic code with it, you may move on to Multi Theft Auto specific scripting.

Up-to-date Multi Theft Auto scripting information, details and help can be found on the Multi Theft Auto Wiki site. Get yourself familiarized with the scripting features Multi Theft Auto offers you by reading articles of which links you can find on the right side of the Wiki front page under the Scripting heading:

» Server Manual

» Introduction to scripting

» Introduction to scripting the GUI

» Debugging Tutorial

» Introduction to resources

» meta.xml


You might also find the Tutorials board useful. These are tutorials, manuals and help topics written by community members. If Wiki seems a little bit too hardcore for you at the moment, checking this board should get you started easily.

Feel free to also use our available chatting channels to ask questions and get help in general. These can be found at the IRC Channel Wiki article. Make sure to search for an answer on your preferred search engine first, and through the forum search feature. This way you can find solutions faster and will keep our channels clean of already answered questions!

If you have code which you can post on your topic, that would make it easier for helpers to get a solution for you faster. Keep in mind that we are a public forum and we can only fix your code if you are willing to post it on your topic. This way we give you help and eventually a solution, and if someone else is facing the same issue later they can find a solution to the problem from your topic.

I hope this got you started up!

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Create New...