What's wrong with this Kill script?

Post » Mon Dec 30, 2013 11:14 am

Victim.Kill(Killer)

All I want is that an Actor kills another Actor. I am using this papyrus fragment in a quest. CK says that "Kill" is not a function or does not exist. I have 2 actors as objectreference properties, Victim and Killer. A butcher is going to slaughter a cow. Ideas why this simple script is failing?

User avatar
Sarah Bishop
 
Posts: 3387
Joined: Wed Oct 04, 2006 9:59 pm

Post » Mon Dec 30, 2013 3:50 pm

I think the problem is that you are trying to use a function from the Actor script on an ObjectReference. The Actor script extends the ObjectReference script so you can use functions from the ObjectReference script on Actors, but you cannot use functions from the Actor script on ObjectReferences. I think this situation is usually explained with a phrase along the lines of "humans are mammals, but not all mammals are human".

Change the property type or cast the properties as Actors when calling the function.

(Victim as Actor).Kill(Killer as Actor)
User avatar
flora
 
Posts: 3479
Joined: Fri Jun 23, 2006 1:48 am


Return to V - Skyrim