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

I'm making a placement script but there's an error with the 'new' on line 4 What's wrong?

Asked by 5 years ago

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")

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. IrishStukov 20 — 5y
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 :( Voideyz 4 — 5y

Answer this question