Jump to content

moveTo with PlayIdleWithTarget


Indarello

Recommended Posts

Player.moveTo(Bed, 0, 0, 0, True)
Player.PlayIdleWithTarget(Sleep_anim, Bed)
Bed is static and placed in the same cell as Player, cell in not small so it have loadscreen when it move player to bed
The problem is that Player.PlayIdleWithTarget(Sleep_anim, Bed)
is not working
if i set
Player.moveTo(Bed, 0, 0, 0, True)
Utility.Wait(10.0)
Player.PlayIdleWithTarget(Sleep_anim, Bed)

This working but I need to applay animation immidiatly on load

How I can make this?

I also tried DisableNoWait()

Edited by Indarello
Link to comment
Share on other sites

Using TranslateToRef it should work because the player is in the same cell than the bed, this function doesn't show a load screen. Then in the event OnTranslationComplete use PlayIdleWithTarget.

Function SomeFunction()
	RegisterForRemoteEvent(Player, "OnTranslationComplete")
	Player.TranslateToRef(Bed, 1000.0)
EndFunction

Event ObjectReference.OnTranslationComplete(ObjectReference akSender)
	UnregisterForRemoteEvent(akSender, "OnTranslationComplete")
	akSender.PlayIdleWithTarget(Sleep_anim, Bed)
EndEvent
Edited by DieFeM
Link to comment
Share on other sites

  • Recently Browsing   0 members

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