I have been trying to make my own flashlight script, though there are already many out there, I just wanted to try it on my own. It hasn’t worked out, and I have tried to just take baby steps and try disabling the flashlight and I can’t even manage to do that. Here is what I did and the error I get with it
function disablingflashlight() ply:AllowFlashlight(false) end hook.Add("Think","Disable ze flashlight", disablingflashlight)
[ERROR] RunString:5: attempt to index global 'ply' (a nil value) 1. fn - RunString:5 2. unknown - addons/ulib/lua/ulib/shared/hook.lua:183
And yes I run it serverside… Any ideas?
[editline]20th February 2015[/editline]
and I have also tried to do LocalPlayer():AllowFlashlight(false) and Player:AllowFlashlight(false)