Jump to content

Remove Items Spawn


NCrawler

Recommended Posts

If you ever have the need to remove one of the default items from the spawn list, then this code should help you out.

require 'Items/SuburbsDistributions'for i,v in pairs(SuburbsDistributions) do	if v.items ~= nil then		local k=1		while k <= #v.items do			if v.items[k] == "Base.Pen" then 				table.remove(v.items, k)				table.remove(v.items, k)			elseif v.items[k] == "Base.Pencil" then				table.remove(v.items, k)				table.remove(v.items, k)			else				k = k + 1			end		end	else		for i2, v2 in pairs(v) do			if v2.items ~= nil then				local k=1				while k <= #v2.items do					if v2.items[k] == "Base.Pen" then 						table.remove(v2.items, k)						table.remove(v2.items, k)					elseif v2.items[k] == "Base.Pencil" then						table.remove(v2.items, k)						table.remove(v2.items, k)					else						k = k + 1					end				end			end		end	endend

You can add more elseif lines to add more items or delete them if fewer are required.  Hope this will help someone.  There are too few code examples here in the tutorial section...

Link to comment
Share on other sites

  • 5 years later...

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...