Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

Terrain scripting help

I'm trying to make a terrain building tool, and I need help. This script isn't working.

The output says that on Line 10, Argument 6 is missing or nil.

local deb = false
print("waht")
script.Parent.Equipped:connect(function(mouse)
	print"lol" 
	mouse.Button1Down:connect(function()
		print("running")
		if deb ~= true then
			deb = true
			local dacell = Workspace.Terrain:WorldToCellPreferEmpty(Vector3.new(mouse.Hit.p))
			local actcell = Workspace.Terrain:SetCell(dacell,Enum.CellMaterial.Cement,Enum.CellOrientation.X)
			wait(1)
			deb = false
		end
	end)
end)
17:23:14.438 - Argument 6 missing or nil
17:23:14.438 - Script 'Players.Player1.Backpack.Tool.LocalScript', Line 10
17:23:14.438 - stack end
17:23:14.439 - Disconnected event because of exception

1 answer

You missed an argument on line 10, the CellBlock (or 3rd, in your case) argument.

local actcell = Workspace.Terrain:SetCell(dacell,Enum.CellMaterial.Cement,Enum.CellBlock.Solid,Enum.CellOrientation.X)

This information, about the SetCell method, is on the wiki, so try looking there when you get stumpted too!

This discussion is preserved as it was. New answers, comments, and votes are closed.