Yeah, so you can do this by using the (has LOS to object) event. Do something like,
If Alligator has LOS to Player
Alligator stop animation walk
>>> Alligator set speed to 0
>>> Alligator set animation to Attack
If Alligator Not has LOS to Player
>>> Alligator set animation to walk
>>> Alligator set speed to (speed value)
You can invert (use the not command) by right clicking a condition on an event and selecting the X.
Hope that helps!