1. You use plrunderwater as an ACTION, while it is a CONDITION.
2. It only (seems to) works once because you go to state=1, which does not exist. This means the script stops.
Try this.
;Artificial Intelligence Script
;Header
desc = setup water
;Triggers
:state=0:water=1,waterfogdist=600,waterred=255,watergreen=225,waterheightofzone=70,state=5
:state=5,plrunderwater=1:etimerstart,state=10
:state=10,plrunderwater=1,etimergreater=3000:plrsubhealth=10,state=20
:state=10,plrunderwater=0:state=5
:state=20,plrunderwater=1:etimerstart,state=10
:state=20,plrunderwater=0:state=5
;End of Script
It uses state=5 to check if you are in the water. If so, a timer starts while going to state=10.
After 3 seconds (etimergreater=3000) and the condition plrunderwater=1 is still true.. the scripts does a plrsubhealth=10 and continues to state=20
state=20 checks whether you are still in the water or not.
If true, a timer starts and state=10 is called.. else you go back to state=5, waiting for the player to go into the water again.
this way you lose 10 healthpoints every 3 seconds you are in the water.
I did NOT test this script myself.
EDIT.. i realised the use of waterCOLOR is not right.
Quote: "WATERBLUE=X
Description: This sets the blue component of the water’s colour.
Range: X = 0 to 255
"
Same goes for waterRED and waterGREEN..
I changed them in the above script.. waterRED=900 to 255 and waterGREEN=700 to 225
Grts
Anubis
-+- There are only 10 types of people in the world. Those who understand binary, and those who don't -+-
[Chipset:X58 CPU:i7.950.64 GPU:HD5970 RAM:12GB DDR3 WIN:7.x64 PRO FPSC:1.20.10]