// SPDX-License-Identifier: MIT // Copyright (c) 2026 Incoprea // Vehicle speed display // Not compiled or tested in-world // Setup: Put in the root of a moving object or a suitable attachment. Owner-touch turns the instrument on and off. // Stop / restore: Touch to stop and restore the original hover text before removal. // Notes: Reads existing velocity only; it never changes physical status, vehicle settings, or movement. Teleports and scripted position jumps need not appear as meaningful velocity. // License: see LICENSE in this distribution. // Original Incoprea example. MIT. Not compiled or tested in-world. integer active; list original; default { state_entry() { original = llGetLinkPrimitiveParams(LINK_THIS, [PRIM_TEXT]); } touch_start(integer count) { if (llDetectedKey(0) != llGetOwner()) return; active = !active; if (active) llSetTimerEvent(0.5); else { llSetTimerEvent(0.0); llSetLinkPrimitiveParamsFast(LINK_THIS, [PRIM_TEXT] + original); } } timer() { float speed = llVecMag(llGetVel()); llSetText((string)(llRound(speed * 10.0) / 10.0) + " m/s\n" + (string)(llRound(speed * 36.0) / 10.0) + " km/h", <0.7, 1.0, 0.8>, 1.0); } }