Clickdetector is not a valid member of Model

Viewed 42

Summarize the problem Clickdetector is not a valid member of Model.

Describe what you’ve tried I've tried writing it in different ways, searched on google the cause but nothing solve it.

When appropriate, show some code code that creates the clickdetector

local function Create()
    local ClickDetect = Instance.new('ClickDetector', game.Workspace.Tables.B.SegnalinoAttivo)
end

game.Workspace.Clients.Table2.CopyClick.OnServerEvent:Connect(Create)

code that shows the error (line 6)

local Clients = 0

local function ClientsNumber (player, num)
    wait(1)
    game.Workspace.Tables.B.SegnalinoAttivo:WaitForChild("ClickDetector")
    local ClickSegnalino = game.Workspace.Tables.B.SegnalinoAttivo.Clickdetector
    Clients = num
    print("Client at Table B = ")
    print(num)
    ClickSegnalino:Destroy()
    print("Destroyed the click detector")
    local ComeHereWait = Instance.new('Part', game.Workspace.Clients.Table2)
end

game.Workspace.Clients.Table2.RemoteEvent.OnServerEvent:Connect(ClientsNumber)
1 Answers

You have incorrect capitalization. Near the end of line 6, instead of ClickDetector, you put Clickdetector

Related