Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Terrain scripting help

Asked by 10 years ago

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

Log in to vote
0
Answered by
User#2 0
10 years ago

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!

Ad

Answer this question