Why can't i set values of an object from a class I made?

So I’m trying to set a value inside of an object of a class in my OnBegin script,
this is the class:
Profile := class:
var Money : float = 150.0

Spend(Out:float)<decides><transacts>:void = Self.Money=Self.Money-Out

this function always fails: if(PlayerProfile.Spend[12.0]){Print(“Success”)} else{Print(“Fail”)}

oh and the object is created like: PlayerProfile := Profile{Money:=initmoney}
where initmoney is an editable float

I’m not sure if any of these changes matter, but here’s how I would have done it (in case it helps).

var Money : float = 150.0

Spend(Out:float)<decides><transacts> : void =
    set Money = Money - Out

Maybe the ‘set’ is needed.