error: 15:44:00.918 - Players.Voideyz.PlayerGui.ScreenGui.Placement:4: attempt to call field 'new' (a nil value)

local placementHandler = require(script:WaitForChild("PlacementModule"))
local base = workspace.Base
local items = game:GetService("ReplicatedStorage").Items
local plane = placementHandler.new(base.Baseplate, base.ItemHolder, 3)


local dummyModel


local function initiatePlacement(itemName)
	dummyModel = items(itemName):clone()
	
	for _, object in pairs(dummyModel:GetChildren()) do
		if (object:IsA("BasePart")) then
			object.CanCollide = false
		end
		
		
	  end
	


dummyModel.Parent = workspace

plane:enable(dummyModel)
end



wait(3)

initiatePlacement("EnergyCube")

2 comments

0

if im not mistaken this was in a tutorial video? I would suggest reviewing over the script inside the video to better understand your mistake.

0

I did but it's exactly the same script. Even at the end of the video when i copied everything all over again the same error happens :(