Solved ecuations in a function

  • Welcome to skUnity!

    Welcome to skUnity! This is a forum where members of the Skript community can communicate and interact. Skript Resource Creators can post their Resources for all to see and use.

    If you haven't done so already, feel free to join our official Discord server to expand your level of interaction with the comminuty!

    Now, what are you waiting for? Join the community now!

  • LOOKING FOR A VERSION OF SKRIPT?

    You can always check out skUnity Downloads for downloads and any other information about Skript!

Status
Not open for further replies.

Mich

Active Member
Jul 15, 2020
148
6
18
23
Script Version (do not put latest): 2.6.1
Script Author: TPGamesNL
Minecraft Version: 1.18.2

I am making a linear interpolation formula for a custom health skript. I need to know how to make this work
Console error:
§c Can't understand this condition/effect: set {_result} to ((%{_v}% - 0)(10-0)) / (%{vidamaxima::%{_p}%}% - %{vida::%{_p}%}%)
§6 Line: §7set {_result} to ((%{_v}% - 0)(10-0)) / (%{vidamaxima::%{_p}%}% - %{vida::%{_p}%}%)
§r
Code
Code:
function vidaI(v: number, p: player) :: number:
    set {_result} to ((%{_v}% - 0)(10-0)) / (%{vidamaxima::%{_p}%}% - %{vida::%{_p}%}%)
    return {_result}
on heal:
    set {_vida} to health of player
    set {_nuevavida} to vidaI({_vida}, player)
    set {vida::%player%} to {_nuevavida}
 
Im not sure you need the parenthesis around then entire equation. What this is doing is basically just
Code:
set {_result} to (5)
Other than that I'm not sure what's wrong
 
  • Like
Reactions: Mich
Im not sure you need the parenthesis around then entire equation. What this is doing is basically just
Code:
set {_result} to (5)
Other than that I'm not sure what's wrong
I'm not sure why is not working but I did this instead
Code:
Set {_x} to (10 * {_v})
Set {_y} to ({vidamaxima::%player%} - {vida::%player%})
Set {_result} to ({_x}/{_y})
 
Status
Not open for further replies.