Hiya, I had some code that was working fine until the update but not is erroring:
The error relates to the property ownerPlayer which I guess has been renamed or something - I tried plyer but still no joy.Code:var log = plan.ownerPlayer + ' placed ' + entityNiceName + '.', location = plan.ownerPlayer.transform.position;
Can anyone tell me what the new property is called?
Thanks in advance!
Solved OnEntityBuilt ownerPlayer value no longer available?
Discussion in 'Rust Development' started by Rebajas, Jul 17, 2016.
-
I am not sure but I have been told its something like GetOwnerPlayer() now.
-
Do you know the JavaScript syntax - I tried:
but no joy, still undefined.Code:var player = plan.GetOwnerPlayer(), log = plan.player + ' placed ' + entityNiceName + '.',
[DOUBLEPOST=1468759085][/DOUBLEPOST]Oh balls - I see what might be wrong: plan.player still on my second line...
[DOUBLEPOST=1468759575][/DOUBLEPOST]That worked great - thanks
Totally unrelated, but is there a similar thing for OnEntityDeath to find out who killed an entity? -
HitInfo.Initiator
