local objects = {
--- object lista
}
local col = createColSphere(X,Y,Z, 100) -- ahol lesz a range
function watchChanges( )
---- készenlét
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( ) ) )
setElementInterior( value, 0 )
end
elseif getElementDimension( getLocalPlayer( ) ) == 0 and getElementDimension( objects[1] ) ~= 65535 then
for key, value in pairs( objects ) do
setElementDimension( value, 65535 )
setElementInterior( value, 0 )
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
)
for key, value in pairs( objects ) do
setElementDimension( value, 65535 )
setElementInterior( value, 0 )
end
for index, object in ipairs ( objects ) do
setElementDoubleSided ( object, true )
setElementCollisionsEnabled ( object, true )
end