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

Why does it say that 'model is not a valid member of workspace'?

Asked by
seikkatsu 110
5 years ago
-------------------------------------< variables >---------------------------------------
local model = workspace.Model
local dummies = model:GetChildren("Dummy")
local humsInGame = {}
-------------------------------------< code >--------------------------------------------
script.Parent.Touched:Connect(function(hit)
    game.Players.PlayerAdded:Conect(function(pl)
        local char = pl.Character
        if char then
            print("found")
        end
    end)
end)

this script is parented to a part that is parented to a tool in the starter pack (the part is called Handle btw) why does it say'

20:09:44.823 - Model is not a valid member of Workspace
0
Well is there an instance named "Model" in the workspace? Benbebop 1049 — 5y
0
also there is a typo in "game.Players.PlayerAdded:Conect(function(pl)" Benbebop 1049 — 5y
0
yeah there is seikkatsu 110 — 5y
0
yeah there is seikkatsu 110 — 5y

1 answer

Log in to vote
1
Answered by
Benbebop 1049 Moderation Voter
5 years ago
Edited 5 years ago

You tried to set the variable model to an instance named Model in the workspace. It seems like that instance doesn't exist. Make sure there is an instance named Model in the workspace and it should work. If there is multiple of them make sure it is named differently.

Ad

Answer this question