Theres a couple of issues stopping a simple answer to your request but I will do my best.
The createCow script is a client script but a click entity is an entity script so there needs to be some extra code changes to make the 2 work together, heres a simple click entity script to change colors.
(function(){
var clicked = false;
this.mousePressOnEntity = function(entityID, mouseEvent) {
if (clicked){
Entities.editEntity(entityID, { color: { red: 0, green: 255, blue: 255} });
clicked = false;
}else{
Entities.editEntity(entityID, { color: { red: 255, green: 255, blue: 0} });
clicked = true;
}
};
})
put that in a cube and click it, now play with the params and get to know it.
here is its bare bones, look at the log for the “Clicked” output to know its working.
(function(){
this.mousePressOnEntity = function(entityID, mouseEvent) {
print(“clicked”);
};
})
(edited to remove some incorrect info)
So start with a simple Entities.addEntity before you try to create that cow with its scripts and animations.