Skip to main content

Animal

Contains functions for animals.

info

This module can only be used in Entity scripts.

Functions

playEmote(emote, asyncMode)

Plays emote on the current animal.

Parameters

  • emote AnimalEmote to play.
  • asyncMode The AsyncMode which determines whether the task should wait for the function to complete before continuing.

Example

Make an animal eat every 5 seconds.

function onStart()
while true do
Animal.playEmote(AnimalEmote.Eat)
Task.wait(5)
end
end

playPersistentEmote(emote, loop)

Plays persistent emote on the current animal.

Parameters

  • emote AnimalEmote to play.
  • loop If 'false' the animation will stay in the last frame of the emote. If 'true' the animation will loop until another emote plays.

Example

Call a function that will play a death animation when animal is killed and stays on death position.

function playDeathAnimation()
Animal.playPersistentEmote(AnimalEmote.Death, false)
end

playFaceEmote(faceEmote)

Enums

AnimalEmote

Emotes available for animals.

  • None value = 0
  • Eat value = 1
  • Attack value = 2
  • Clicked value = 3
  • Fly value = 4
  • Roll value = 5
  • Sit value = 6
  • Swim value = 7
  • Bounce value = 8
  • Death value = 9
  • Fear value = 10
  • Hit value = 11
  • Jump value = 12
  • Spin value = 13

AnimalFaceEmote

Faces available for animals.

  • None value = 0
  • EyesAnnoyed value = 1
  • EyesDead value = 2
  • EyesLookDown value = 3
  • EyesLookUp value = 4
  • EyesShrink value = 5
  • EyesSquint value = 6
  • EyesBlink value = 7
  • EyesExcited value = 8
  • EyesLookIn value = 9
  • EyesRabid value = 10
  • EyesSleep value = 11
  • EyesTrauma value = 12
  • EyesCry value = 13
  • EyesHappy value = 14
  • EyesLookOut value = 15
  • EyesSad value = 16
  • EyesSpin value = 17
  • SweatRight value = 18
  • SweatLeft value = 19
  • TeardropRight value = 20
  • TeardropLeft value = 21