Script Call error causing crashing

Hello,

These 2 script calls appear to be causing errors, I assume syntax is the issue, any help would be appreciated.

1.
Objective: Set Actor (event ID - 10) Hp to event x coordinate
$gameActors.actor((this.character(0)-10)).setHp(this.character(0).x)

2.
Objective: Set Actor 25's Tp to price of item using Actor 25's Hp as the item ID
$gameActors.actor(25).setTp($dataItems(($gameActors.actor(25).Hp)).price)

Thanks
Hello,

These 2 script calls appear to be causing errors, I assume syntax is the issue, any help would be appreciated.

1.
Objective: Set Actor (event ID - 10) Hp to event x coordinate
$gameActors.actor((this.character(0)-10)).setHp(this.character(0).x)

2.
Objective: Set Actor 25's Tp to price of item using Actor 25's Hp as the item ID
$gameActors.actor(25).setTp($dataItems(($gameActors.actor(25).Hp)).price)

Thanks
1. The interpreter's character() function returns an event. You're trying to subtract 10 from an event. An event is not a number you can do maths with. 🙂

2. The hp property doesn't have a capital H, and $dataItems is an array, not a function.
The interpreter's character() function returns an event. You're trying to subtract 10 from an event. An event is not a number you can do maths with. 🙂
Perfect, am new to programming so lots of trying things out
Where did you get the idea that character worked like that, out of curiosity?

Original thread: https://forums.rpgmakerweb.com/threads/script-call-error-causing-crashing.156001/