Jump to content

Not working table!


Recommended Posts

local szefpozicio = {"2485.87524, -1666.34705, 13.34380", "2487.87526, -1666.34705, 13.34380"}
local szef = createObject (2634, tonumber(szefpozicio[0]))
local szefrectangle = createColRectangle (2485.8720703125, -1665.8211669922, 5, 5)

function szefopen(jatekos)
    if isElementWithinColShape (jatekos, szefrectangle) then
        moveObject (szef, 5000, tonumber(szefpozicio[1]))
        outputChatBox (math.random(1, 2))
    end
end
addCommandHandler ("felfeszit", szefopen)

It supposed to open on command enter "felfeszit". But:
WARNING: teszt\bankrob.CodeS.lua:2: Bad argument @ 'createObject' [Expected vector3 at argument 2, got nil]

Edited by rusztamas
Link to comment

this should work

local szefpozicio = {2485.87524, -1666.34705, 13.34380,2487.87526, -1666.34705, 13.34380}
local szef = createObject (2634, tonumber(szefpozicio[0]))
local szefrectangle = createColRectangle (2485.8720703125, -1665.8211669922, 5, 5)

function szefopen(jatekos)
    if isElementWithinColShape (jatekos, szefrectangle) then
        moveObject (szef, 5000, tonumber(szefpozicio[1]))
        outputChatBox (math.random(1, 2))
    end
end
addCommandHandler ("felfeszit", szefopen)

 

Edited by Avagard
  • Like 1
Link to comment
local szefpozicio = {
    {2485.87524, -1666.34705, 13.34380},
    {2487.87526, -1666.34705, 13.34380}
}
local szef = createObject (2634, unpack(szefpozicio[1]))
local szefrectangle = createColRectangle (2485.8720703125, -1665.8211669922, 5, 5)

function szefopen(jatekos)
    if isElementWithinColShape (jatekos, szefrectangle) then
        moveObject (szef, 5000, unpack(szefpozicio[2]))
        outputChatBox (math.random(1, 2))
    end
end
addCommandHandler ("felfeszit", szefopen)

 

Edited by ZoRRoM
  • Like 1
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...