Skip to content

SetDogCoat

Sets a dog’s coat - its colour and markings - on every screen.

coat is one of GetDogCoats ("backyard_brown", "alaunt_white", "wardog_black" …; any case). It works on a player’s dog (CreateDog) and on an animal made with CreateAnimal("dog"). The dog changes at once on every screen that has it. A dog never given one wears a pick that changes with the dog’s id (two dogs can share one) - so a mode that keeps dogs saves the coat (GetDogCoat) and gives it back right after making the dog; set in the same moment, it is on from the dog’s first frame. nil or "" goes back to the pick.

SetDogCoat(id [, coat])
Parameter Type
id number the dog
coat string one of GetDogCoats; nil = the pick that goes with the dog’s id again (optional)

boolean - false when it is not a dog or the coat is no coat

-- the kennel gives each player the dog they chose, every time
function OnPlayerSpawn(pid)
local coat = GetPlayerData(pid, "dog_coat")
if coat then SetDogCoat(CreateDog(pid), coat) end
end

GetDogCoat · GetDogCoats · CreateDog · CreateAnimal · the Dogs group of the index