Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- foreach(var entity in entity_list){
- var cubeGrid = entity as IMyCubeGrid;
- if(cubeGrid == null){
- continue; //Move to next entity in loop if cubeGrid was null
- }
- if(cubeGrid.CustomName == "Grid Name Example A"){
- //Do Stuff for "Grid Name Example A"
- }
- if(cubeGrid.CustomName == "Grid Name Example B"){
- //Do Stuff for "Grid Name Example B"
- }
- if(cubeGrid.CustomName.Contains("Delete")){
- //Do stuff to delete the grid if the word "Delete" is found in its name.
- //Keep this at the bottom of your custom name checks.
- //If anything above renames the grid with "Delete", then this will catch it and delete it.
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement