Jump to content

Float Timer Problem


MartinPurvis

Recommended Posts

Hi,

I've searched through the past topics and tried to follow the methods of how to make a script perform actions after a 2 second countdown. The script works and the lights turn on and off but no matter what I change the timer value to, ingame it seems to be 12 seconds. It is attached to an activator.

 

scn 000TheFunhouseStartRoomLightsSCRIPT

int iStage
int DoOnce
Float Timer

Begin OnActivate

if ( DoOnce == 0 )
	if Timer > 0
		Set timer to timer - GetSecondsPassed
	elseif iStage == 0
		set iStage to 1
		Set timer to 1
	elseif iStage == 1
		StartRoomLightsOffREF.disable
		StartRoomLights2OffREF.disable
		StartRoomLightsOnREF.enable
		StartRoomLights2OnREF.enable
		StartRoomLight1REF.enable
		StartRoomLight2REF.enable
		StartRoomLight3REF.enable
		StartRoomLight4REF.enable
		Set DoOnce to 1
	endif
endif
End

 

Would appreciate help on this :) :thumbsup:

Link to comment
Share on other sites

Try this

 

scn TheFunhouseStartRoomLightsSCRIPT

int DoOnce
float Timer

Begin OnActivate

set DoOnce to 1
       set Timer to 1
End

Begin GameMode
if ( DoOnce == 1 )
	if Timer > 0
		set timer to timer - GetSecondsPassed
	else
		StartRoomLightsOffREF.Disable
		StartRoomLights2OffREF.Disable
		StartRoomLightsOnREF.Enable
		StartRoomLights2OnREF.Enable
		StartRoomLight1REF.Enable
		StartRoomLight2REF.Enable
		StartRoomLight3REF.Enable
		StartRoomLight4REF.Enable
		set DoOnce to 0
	endif
endif
END

Edited by Capt Mitch
Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...