wogz187 1086 Posted June 18, 2019 May I have some help to compile this script, if (Plight == 0) then { playSound ["click", true]; cockpit = playerJET; CPlight = "#lightpoint" createVehicle [0,0,0]; CPlight setLightBrightness 0.1; CPLight setLightAmbient [0.0, 1.0, 0.0]; CPlight setLightColor [0.0, 1.0, 0.0]; CPlight attachTo [cockpit, [0,5,-0.5], "vez"]; addMissionEventHandler ["Draw3D", { CPlight setVectorDirAndUp [ (cockpit selectionPosition "pohon") vectorFromTo (cockpit selectionPosition "otochlaven"), [0,0,1]; Plight=1; ]; }]; } else { deletevehicle CPlight; Plight=0; }; It reports "Missing ]" but I don't know where it is. Before the "else", likely. Thanks! Share this post Link to post Share on other sites
Grumpy Old Man 3547 Posted June 18, 2019 You got Plight = 1; inside the setVectorDirAndUp, messing up the syntax. Cheers 1 Share this post Link to post Share on other sites
wogz187 1086 Posted June 18, 2019 @Grumpy Old Man, @sarogahtyp, thanks, this works, CabLight.sqf if (Plight == 0) then { playSound ["click", true]; cockpit = playerJET; CPlight = "#lightpoint" createVehicle [0,0,0]; CPlight setLightBrightness 0.1; CPLight setLightAmbient [0.0, 1.0, 0.0]; CPlight setLightColor [0.0, 1.0, 0.0]; CPlight attachTo [cockpit, [0,5,-0.5], "vez"]; addMissionEventHandler ["Draw3D", { CPlight setVectorDirAndUp [ (cockpit selectionPosition "pohon") vectorFromTo (cockpit selectionPosition "otochlaven"),[0,0,1] ]; }]; plight=1; } else { deletevehicle CPlight; Plight=0; }; Connected to a GUI button to toggle, action = "_nil=[]ExecVM ""CABlight.sqf"""; Actually it works really, really great! Thanks! 1 Share this post Link to post Share on other sites
wogz187 1086 Posted June 18, 2019 Eh, Almost solved. The light still changes position (forward) when the vehicle is in motion and blinks like crazy. Interestingly, the visual effect it has looks like hitting warp speed into a green aurora borealis. The LightPoint will not keep up with the EH or the light properties make it go crazy. Removing light ambient, maybe? This following script works but doesn't allow customizing the light source and it kind of feels like duct-taping a lantern onto the jet. But it does work. CabLight.sqf if (Plight == 0) then { playSound ["click", true]; cockpit = playerJET; CPlight = "Land_PortableLight_single_F" createVehicle [0,0,0]; CPlight attachTo [cockpit, [0,7,-1], "vez"]; addMissionEventHandler ["Draw3D", { CPlight setVectorDirAndUp [ (cockpit selectionPosition "pohon") vectorFromTo (cockpit selectionPosition "vez"),[0,0,0] ]; }]; plight=1; } else { deletevehicle CPlight; Plight=0; }; Share this post Link to post Share on other sites