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

The output says that CanCollide is not a valid value, what went wrong?

Asked by 5 years ago
Edited 5 years ago

There is the script:

Used Tuneabl's Sandbox Tutorial Everything works fine when I comment the Canciollide statement in line 40

--------------------------Vars---------------------------------------------

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 GreyButton = script.Parent.SelectionFrame:WaitForChild("Grey")
local BlueButton = script.Parent.SelectionFrame:WaitForChild("Blue")

local dummyModel
local signal
local currentItemName

------------------------------------------Functions-------------------

local function cancelPlacement()
    if (dummyModel) then
        plane:disable()

        if (dummyModel.Parent) then
            dummyModel:Destroy()
        end

        dummyModel = nil
        signal = nil
        currentItemName = nil
    end
end


local function initiatePlacement(itemName)
    cancelPlacement()

    dummyModel = items[itemName]:clone()    
    currentItemName = itemName

    for _, object in pairs(dummyModel:GetChildren()) do
        if (object:IsA("BasePart")) then
            object.Cancollide = false
        end
    end

    dummyModel.Parent = workspace

    local signal = plane:enable(dummyModel)

    signal:connect(function(location, _)
        game:GetService("ReplicatedStorage").ClientPlaced:FireServer(currentItemName, location[1])

        cancelPlacement()
    end)

end

---------------------------------Buttons----------------------------------

GreyButton.MouseButton1Down:Connect(function()
    initiatePlacement("Grey")
end)

BlueButton.MouseButton1Down:Connect(function()
    initiatePlacement("Blue")
end)

Thanks for the Help!

2 answers

Log in to vote
3
Answered by 5 years ago

You forgot to capitalize the "c" in "Collide"

Ad
Log in to vote
0
Answered by
DJH_100 28
5 years ago

Models dont have can Collide

Answer this question