Custom Afk Device Snippet by DragonRage

im trying to use the custom afk device by dragon rage i have everything setup and it detects me idling but the onplayerbecomesactive trigger just seems to fire of after 2 seconds even when im still idle

any ideas?

here’s the function i think is causing the issue i think although it looks good to me

	    # Watches a currently inactive player to detect movement, and thus set them as active again
	    WatchPlayer<private>(InPlayer : player)<suspends>:void=
	        Sleep(2.0)
	        var PreviousTransform : transform = transform{}
	        var CurrentTransform : transform = transform{}
	        if(InFortChar := InPlayer.GetFortCharacter[]):
	            race:
	                block:
	                    loop:
	                        set PreviousTransform = InFortChar.GetTransform()
	                        Sleep(0.5)
	                        set CurrentTransform = InFortChar.GetTransform()
	                        Sleep(0.5)
	                block:
	                    loop:
	                        if(not ((PreviousTransform.Translation - CurrentTransform.Translation).IsAlmostZero[1.0])):
	                            break
	                        Sleep(0.0)
	                block:
	                    loop:
	                        if(not InFortChar.IsActive[]):
	                            return
	                        Sleep(0.0)
	            SignalSend_Module.ActivateTrigger_OnInactivePlayerBecomesActive.Trigger(InPlayer)
	        else:
	            Print("~Failed to get fort_character of inactive player")
	        NotePlayer(InPlayer)

ok i managed to make it work after some investigation

because of the Race parameter the first loop to complete is the result taken
this meant beacause the sleep(0.5) in the first loop the current location parameter didn’t have time to be set before the second loop completed

i just set the variables b4 the race began and it worked great

     if(InFortChar := InPlayer.GetFortCharacter[]):     
            set PreviousTransform = InFortChar.GetTransform()
            set CurrentTransform = InFortChar.GetTransform()
                race:
	                block:
	                    loop:

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.