Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local r = 255
- local b = 0
- light = false
- hook.Add("Think", "HookKeyManagement", function()
- for i=1, 159 do
- if(!vgui.CursorVisible) then break; end;
- if(input.WasKeyPressed(i)) then
- hook.Call("KeyPressed", nil, i);
- end;
- if(input.WasKeyReleased(i)) then
- hook.Call("KeyReleased", nil, i);
- end;
- end;
- end);
- hook.Add("KeyReleased", "TestShiftBlablabla", function(Key, Released)
- if(Key == KEY_LSHIFT and Released) then
- if light == false then
- LightOn()
- end
- if light == true then
- LightOff()
- end
- end
- end)
- function LightOn()
- light = true
- print("light on")
- local dlight = DynamicLight( LocalPlayer():GetVehicle():EntIndex() )
- dlight.pos = LocalPlayer():GetVehicle():GetPos()
- dlight.r = r
- dlight.g = 0
- dlight.b = b
- dlight.brightness = 2
- dlight.Decay = 1000
- dlight.Size = 256
- dlight.DieTime = CurTime() + 1
- end
- function LightOff()
- light = false
- print("light off")
- r = 0
- b = 0
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement