I have no idea on how i can do it
If you want to low-poly every model with Lua, I don't think you can. What you could do is replace all the models in workspace
with the low-poly models you made, but that's unideal. If you're looking to reduce lag, you could make a script that removes all textures and change all materials to SmoothPlastic
.
A better solution is have all models in Lighting, based off player selection, lets say in a UI menu, they could select High Model Detai lwhich would enable a local script to clone everything from a folder in Lighting to workspace & vise versa with the low poly models, should reduce ram usage & GPU latency, wont reduce download size however.