Theres no function or way to change variable types. If there is can someone guide me on how to do it?
The .type is a public, non-readonly property of VariableModel. As far as I am aware you can change the type of a variable by getting its model and directly mutating this property—though I can't promise that this won't have some surprising consequences; notably, this will not cause any connection checks to be done, so you may find that a previously-valid program has become invalid due to now-illegal connections.