ItsDeltin / Overwatch-Script-To-Workshop

Converts scripts to Overwatch workshops.
207 stars 24 forks source link

FilteredArray() of players fails to get type player. #367

Closed Postur closed 2 years ago

Postur commented 2 years ago

My filtered array of players should have the GOLDminestatus variable of each player. however here it is out of scope. image My guess is the FilteredArray() method doesn't get the type from the first argument, and always returns an any type. But in Overwatch this action is totally valid.

image

How can I enforce a type? Thanks.

Protowalker commented 2 years ago

While we fix this bug, you can use typecasting as a workaround. If you have a value of one type and you want it to act like a value of another type, do <OtherType>valueOfFirstType

Postur commented 2 years ago

Thank you! I also had to add ( ) to encase the type before accessing the value. Everything working as expected now :)

image

Protowalker commented 2 years ago

Sorry for taking 4 days to respond! I didn't realize you had asked how you could enforce the type when I first read it.