first, Using code tags properly
I assume the button calls “spellcast”?, where do you check if “isCasted” is true before calling it again?, I mean - turning off the players ability to call it should be fine, but a sanity check in spellcast won’t hurt.
IE
public void spellcast()
{
if(isCasted)
return;
MS.star -= cost;
isCasted = true;
MS.starps += bonus;
StartCoroutine(casted());
}
I’m not sure what is going on with the bonus calculation thingy so I won’t comment on that.