BiteeeMe Posted July 17, 2012 Share Posted July 17, 2012 I have a weird problem. I am new to LUA and have decided to add in a custom interior. This is purely a test and only has two doors I want to implement. I am having trouble actually doing so. Here is the code. local objects = { createObject (1491,1260.4200439453,-805.79998779297,1083,0,0,90,5), createObject (1491,1260.4000244141,-802.79998779297,1083,0,0,270,5) } local col = createColSphere(1260.5799560547,-785.30999755859,1090.9599609375, 50) local function watchChanges( ) if getElementDimension( getLocalPlayer( ) ) > 0 and getElementDimension( getLocalPlayer( ) ) ~= getElementDimension( objects[1] ) and getElementInterior( getLocalPlayer( ) ) == getElementInterior( objects[1] ) then for key, value in pairs( objects ) do setElementDimension( value, getElementDimension( getLocalPlayer( ) ) ) end elseif getElementDimension( getLocalPlayer( ) ) == 0 and getElementDimension( objects[1] ) ~= 65535 then for key, value in pairs( objects ) do setElementDimension( value, 65535 ) end end end addEventHandler( "onClientColShapeHit", col, function( element ) if element == getLocalPlayer( ) then addEventHandler( "onClientRender", root, watchChanges ) end end ) addEventHandler( "onClientColShapeLeave", col, function( element ) if element == getLocalPlayer( ) then removeEventHandler( "onClientRender", root, watchChanges ) end end ) -- Put them standby for now. for key, value in pairs( objects ) do local x, y, z = getElementPosition( value ) setElementPosition( value, x, y, z + 40 ) setElementDimension( value, 65535 ) end ="custom/maddogs.lua" type="client"/> { 5, 1260.579, -785.309, 1090.95, 0 } -- 135 Madd Dogs (custom-interior) I mean, other custom-interiors (that have already been scripted) work just fine. I don't know where I am going wrong, I would appreciate it a lot if you could point me in the right direction and fix this error! Thanks in advance. Regards, BiteeeMe! Link to comment
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now