Allright, I may seem stupid, but I have been learning blitz for all of two days, and I am still having some difficulties.
I am trying to get a door to open and close using the same key (e).
My code is:
If KeyHit(18) Then
If EntityDistance#(p\entity,motellcd) < 20
If EntityYaw# (motellcd) = 0 Then
.Dooro
If doory<91 Then
doory=doory+1
RotateEntity motellcd,0,doory,0
Goto dooro
EndIf
EndIf
If EntityYaw# (motellcd) > 89 Then
.Doorc
If doory2>0 Then
doory2=doory2-1
RotateEntity motellcd,0,doory2,0
Goto doorc
EndIf
EndIf
EndIf
EndIf
Of course what happens is the door will open but not close. Is there any way of fixing this... I have gotten the code to work using two seperate keys, but not using the same key.
I am trying to get a door to open and close using the same key (e).
My code is:
If KeyHit(18) Then
If EntityDistance#(p\entity,motellcd) < 20
If EntityYaw# (motellcd) = 0 Then
.Dooro
If doory<91 Then
doory=doory+1
RotateEntity motellcd,0,doory,0
Goto dooro
EndIf
EndIf
If EntityYaw# (motellcd) > 89 Then
.Doorc
If doory2>0 Then
doory2=doory2-1
RotateEntity motellcd,0,doory2,0
Goto doorc
EndIf
EndIf
EndIf
EndIf
Of course what happens is the door will open but not close. Is there any way of fixing this... I have gotten the code to work using two seperate keys, but not using the same key.