ScriptName aaaSGAsToy extends ObjectReference

Actor Property PlayerRef Auto
SexLabFramework Property SexLab Auto

Event OnEquipped(Actor akActor)

	If SexLab.IsValidActor(akActor)
	
		If (PlayerRef == akActor)
			While (Utility.IsInMenuMode())
				Utility.WaitMenuMode(3.0)
			EndWhile
		EndIf
	
		Debug.Trace("-SSLToys- Starting sex")
		TriggerSex(akActor)
		
		
	
	EndIf
	
endEvent

Function TriggerSex(Actor akActor)

		sslBaseAnimation Animation1 = SexLab.GetAnimationByName("Nibbles Chair Dildo")  ; This animations have to be in the animation register
		
		IF (Animation1 == None)
			Debug.Trace("-SSLToys- no animations found")
			Return
		EndIf
		
		sslBaseAnimation[] AnimationList = new sslBaseAnimation[1]
		AnimationList[0] = Animation1
	
		; //create a new animation thread instance and store it in the "thread" variable
		sslThreadModel thread = SexLab.NewThread()
		
		; //add the first actor
		;If !
		thread.AddActor(akActor)
		;	Debug.Trace("-SSLToys- faild to add the actor")
		;	Return
		;EndIf
	
		thread.SetAnimations(AnimationList)
		
		thread.StartThread()
		
EndFunction
