Strength Test

I’m having an issue getting my code to function correctly. I just want a simple strength test - 17 > = PASS. 16 < Fail

Its supposed to be a simple - move statue/destroy statue/create new statue, provided the test is met.
As it stands now everyone passes the test… :frowning:

I’m not entirely sure I’m even using the right function, and have searched for other functions…
Code so far:

void main()
{
    object oPC = GetLastUsedBy();
    if (!GetIsPC(oPC)) return;

    if ( GetAbilityScore(oPC, ABILITY_STRENGTH, 17 ) )
    {
        object oZeldaChime = GetObjectByTag("ZELDA_CHIME_01");
        SoundObjectSetPosition(oZeldaChime, GetPosition(oPC));
        SoundObjectSetVolume(oZeldaChime, 127);
        SoundObjectPlay(oZeldaChime);

        string sBrickscrape = "as_dr_stonmedop1";
        DelayCommand(0.3, PlaySound(sBrickscrape));
        DestroyObject(OBJECT_SELF, 0.5);

        CreateObject(OBJECT_TYPE_PLACEABLE, "statue043", GetLocation(GetWaypointByTag("STAT_LOC_01")));
    }
    else if ( GetAbilityScore(oPC,  ABILITY_STRENGTH, 16) )
    {
        AssignCommand(oPC,  ActionSpeakString("You lack the adequate strength to move the statue..."));
    }
}

Thnaks guys… :slight_smile:

Try

2 Likes

Thought I tried that. Using both >= but didn’t compile. Seems I forgot to shore off ABILITY_STRENGTH with a curly bracket ) before comparison.
Many thanks for the catch, friend.

) is not curly bracket. } is. If you put curly bracket there it would also not compile :slight_smile:

1 Like

Alright. My nomenclature sucks. :crazy_face: A parathesis ) then…