Hello Facepuch users.
This is actually my first post but I’ve been on the forums for lot of time and really helped me with many things.
As I’m starting this thread I’m needing help with a small LUA code that I’m trying to do. I am not an experienced user with LUA, I’m mostly with PHP, Perl and those.
I would please ask for help on this small thing which I think will be easy for the experienced users… Actually I’m trying to run a command when the player is on a vehicle and he press SHIFT Key (KEY_LSHIFT)
Here I attach the small code which I tried to do.
function VehicleSirenCheck() ply = LocalPlayer() if ply:InVehicle() then return true else return false end end local Think = function() if VehicleCheck() if LocalPlayer():KeyDown(KEY_LSHIFT) then ply:ConCommand("VC_ToggleSirenOnOff") end end end hook.Add("Think", "My button hook", VehicleSirenCheck)
Is it correct? Do I have to do something else?
I’m really not sure on this language, it’s really weird to me, so excuse me if I’m too ignorant on this.
Thanks for reading and helping.
I appreciate it.
With best regards,