I have this script that is designed to the the player/npc who touches them but only once. Then after 10 seconds it resets so that if the player/npc touches them again they get hurt again and so forth.
but the script doesnt seem to work and I cannot see the problem, can anyone help please?
included in the code is ghostnulls origonal notes.
Begin sm_GN_Falmer_Spike_Script
; ATTACH THIS TO THE SPIKES
; This works as is. It hurts the player or NPC/Creature that touches
; the spikes. But, it only hurts whomever touched the spikes first and
; only once. The HurtTimer is there to keep the player or NPC/Creature
; from constantly getting damaged. It resets in roughly the same amount
; of time for the pit block to fully reset. Once again, the problem is
; that the spikes won't hurt the player or NPC/Creature at the same time.
; Suppose NPCS/Creatures could be immune, then you could use the
; ModCurrentHealth function to damage the player, which could then be
; further scripted to be "level-based" damage. Another thought is to just
; have two sets of spikes, one with a size scale set .01 lower than the other
; them script them seperately for players and NPC for damage
short HurtOnce
float HurtTimer
If ( HurtOnce == 0 )
Set HurtOnce to 1
Endif
If ( HurtOnce == 1 )
If ( GetCollidingActor == 1 )
HurtStandingActor 100
Set HurtOnce to 2
Endif
Endif
If ( HurtOnce == 2 )
Set HurtTimer to ( HurtTimer + getsecondspassed )
If ( HurtTimer >= 10 )
Set HurtOnce to 0
Set HurtTimer to 0
Endif
Endif
End
; ATTACH THIS TO THE SPIKES
; This works as is. It hurts the player or NPC/Creature that touches
; the spikes. But, it only hurts whomever touched the spikes first and
; only once. The HurtTimer is there to keep the player or NPC/Creature
; from constantly getting damaged. It resets in roughly the same amount
; of time for the pit block to fully reset. Once again, the problem is
; that the spikes won't hurt the player or NPC/Creature at the same time.
; Suppose NPCS/Creatures could be immune, then you could use the
; ModCurrentHealth function to damage the player, which could then be
; further scripted to be "level-based" damage. Another thought is to just
; have two sets of spikes, one with a size scale set .01 lower than the other
; them script them seperately for players and NPC for damage
short HurtOnce
float HurtTimer
If ( HurtOnce == 0 )
Set HurtOnce to 1
Endif
If ( HurtOnce == 1 )
If ( GetCollidingActor == 1 )
HurtStandingActor 100
Set HurtOnce to 2
Endif
Endif
If ( HurtOnce == 2 )
Set HurtTimer to ( HurtTimer + getsecondspassed )
If ( HurtTimer >= 10 )
Set HurtOnce to 0
Set HurtTimer to 0
Endif
Endif
End