of     1   

tyler1261
#227498377Sunday, November 12, 2017 11:24 PM GMT

I have a turret script that's not working, it's supposed to shoot at something if it can find a target every second (ShotDelay) where shootAtNearest() is the function to shoot the nearest torso, Gun is the gun itself and debounce is false. the code: while true do if findNearestTorso(Gun.Position) ~= nil then shootAtNearest() wait(ShotDelay) else wait(0.2) end end Just a side note, I have multiple functions being declared before this, that piece of code is placed at the absolute end of the script. I have tested the functions individually and they work fine.
tyler1261
#227508216Monday, November 13, 2017 3:25 AM GMT

bump, still have this problem
arin_hanson
#227508520Monday, November 13, 2017 3:33 AM GMT

while wait(0.2) do if findNearestTorso(Gun.Position) ~= nil then shootAtNearest() wait(ShotDelay) end end
tyler1261
#227524836Monday, November 13, 2017 6:58 PM GMT

Still didn't shoot

    of     1