When I try out my own game "The War of Roblox" A game that you have to pick a certain character and fight in a city. But when I entered the server, I suddenly feel a little lag in my game. So I try to make this script to help make the game less lag. Am I doing this correctly? Please, help me.
mx = game.Debris mx2 = game.Debris.MaxItems if (mx.MaxItems > 100) then mx.MaxItems = mx2*.75 end
Usually its just your building type or scripting way (because there's different ways to script a thing to make it lag less) Also most "anti-lag" scripts out there just set a part limit which will ruin your game. I suggest learning to better create your code to reduce lag.
I agree with eLunate. However, the number for the Debris will cause the lag due to the fact that Debris is a game service dealing with individual parts, and the fact that the MaxParts property can be a large number, causing the problem of lag. Also, check the model for textures as those objects definitely create lag.