Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local objectList = {
- ['2291'] = true,
- ['2343'] = true,
- ['2723'] = true,
- ['2724'] = true,
- ['2356'] = true,
- ['1761'] = true,
- ['1762'] = true,
- ['2290'] = true,
- ['2124'] = true,
- ['1708'] = true,
- ['1713'] = true,
- ['1739'] = true,
- ['2090'] = true,
- ['2298'] = true,
- ['1798'] = true
- };
- local showingBar = false;
- function hideBar()
- toggleInfoBar();
- showingBar = false;
- end
- function checkInteractableObjects( )
- local x, y, z, lx, ly, lz, roll, fov = getCameraMatrix()
- local fromX, fromY, fromZ = getElementPosition(getLocalPlayer())
- local toX = fromX + (lx - x)*3
- local toY = fromY + (ly - y)*3
- local toZ = fromZ + (lz - z)*3
- local hit, hitX, hitY, hitZ, hitlineElement, normalX, normalY, normalZ, material, lighting, piece, wmid, wmx, wmy, wmz, wmrx, wmry, wmrz = processLineOfSight(fromX, fromY, fromZ+1, toX, toY, toZ, true, false, false, true, false, false, false, true, getLocalPlayer(), true)
- if hit then
- if hitlineElement then
- model = getElementModel( hitlineElement );
- elseif wmid ~= false then
- model = wmid;
- end
- if not showingBar and objectList[tostring(model)] == true then
- toggleInfoBar("Press 'B' to interact with this object!");
- setTimer(hideBar, 5000, 1);
- showingBar = true;
- end
- end
- end
- addEventHandler("onClientHUDRender", getRootElement(), checkInteractableObjects);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement