Jump to content

How to use a function that only exists in the future?


Lord Henry

Recommended Posts

I was trying to use the function getTrainTrack, but this function is only available from version 1.6 onwards, but actually we are on version 1.5.6 and this function still doesn't exist.

I read the build information and this function was created in 2015. Why is it not available? If the function was removed, I think the wiki page should advise this.

Link to post

I am the one that requested this function. They moved it to 1.6 after my request.
It was finished and added to 1.6 within a few days. @IIYAMA still wondering why, when it could have been easily added to 1.5.6.

Link to post
  • 3 months later...
On 18/03/2019 at 05:19, XaskeL said:

it is written: that it is deleted and will appear only in 1.6

I know. I was the one who marked the deletion. Before my edit, the page doesn't mark the function disabled. (see page history)

(now was fixed to disabled instead of deletion)

Link to post

Simple if would do it

if getTrainTrack and type(getTrainTrack) == "function" then
  --...
end

You can also check if it does exist in the _G table (which contains all global functions provided by mta/Lua)

Link to post

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