Kenneth Posted January 5, 2023 Share Posted January 5, 2023 I want to loop through the values of IsoFlagType[] IsoFlagType:values() --This returns a userdata Since that returns lua userdata how would I go about looping through array since the IsoFlagType.lua says it returns array of IsoFlagType[] ---@public ---@return IsoFlagType[] function IsoFlagType:values() end Link to comment Share on other sites More sharing options...
Kenneth Posted January 7, 2023 Author Share Posted January 7, 2023 I still don't know how to loop through IsoFlagType:values() but I did found a workaround. local function getIsoFlag(propertyContainer) for i, value in pairs(IsoFlagType) do if value and type(value) == "userdata" and value.index and propertyContainer:Is(value) then print("Found IsoFlagType->") print("IsoFlagType: ",value , " type: ",type(value), " index: ",value:index()) return true end end end print(getIsoFlag(getPlayer():getSprite():getProperties())) Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now