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

Case is not a valid member of Model "tumtindy.Case". Whats happening?

Asked by 2 years ago
Edited 2 years ago

Case is not a valid member of Model "tumtindy.Case" is my error,

I am pretty new to scripting, so this might be an obvious mistake but for me it is not. I am trying to make my model called "Sword" be visible inside of my "Case" which is attached to the HumanoidRootPart. (This is for R6)

game.Players.PlayerAdded:Connect(function(player)
    player.CharacterAdded:Connect(function(Character)
        local Case = script.Case:Clone()
        Case:SetPrimaryPartCFrame(Character.HumanoidRootPart.CFrame)
        Case.Parent = Character

        local weld = Instance.new("ManualWeld")
        weld.Part0 = Case.PrimaryPart
        weld.Part1 = Character.PrimaryPart
        weld.C0 = weld.Part0.CFrame:ToObjectSpace(weld.Part1.CFrame)
        weld.Parent = weld.Part0

        local Sword = script.Sword:Clone()
        Sword:SetPrimaryPartCFrame(Case.Case.CFrame * CFrame.new(0,0,-4))
        Sword.Parent = Character

        local weld2 = Instance.new("ManualWeld")
        weld2.Part0 = Sword.PrimaryPart
        weld2.Part1 = Case.PrimaryPart
        weld2.C0 = weld2.Part0.CFrame:ToObjectSpace(weld2.Part1.CFrame)
        weld2.Parent = weld2.Part0
    end)
end)

3 answers

Log in to vote
0
Answered by
Lakodex 711 Moderation Voter
2 years ago

Case is not a valid member of Model is basically an error that describes to you that It is not a member, of model. Or Inside of it.

You require the exact path to the object unless the object is removed. A reason the object could be removed is NoCollide off, Anchored off, not welded to anything (for first 2), deleted by script, or never existed.

Ad
Log in to vote
0
Answered by
Puppynniko 1059 Moderation Voter
2 years ago

Make sure Case exist and didn't get destroyed on run time

Log in to vote
0
Answered by 2 years ago

The problem is very simple, try this one. Well I'm not sure cause I don't know where you really want to place the case or which line break cause you didn't include that.

game.Players.PlayerAdded:Connect(function(player)
    player.CharacterAdded:Connect(function(Character)
        local Case = script.Case:Clone()
        Case:SetPrimaryPartCFrame(Character.HumanoidRootPart.CFrame)
        Case.Parent = Character.HumanoidRootPart

        local weld = Instance.new("ManualWeld")
        weld.Part0 = Case.PrimaryPart
        weld.Part1 = Character.PrimaryPart
        weld.C0 = weld.Part0.CFrame:ToObjectSpace(weld.Part1.CFrame)
        weld.Parent = weld.Part0

        local Sword = script.Sword:Clone()
        Sword:SetPrimaryPartCFrame(Case.Case.CFrame * CFrame.new(0,0,-4))
        Sword.Parent = Character

        local weld2 = Instance.new("ManualWeld")
        weld2.Part0 = Sword.PrimaryPart
        weld2.Part1 = Case.PrimaryPart
        weld2.C0 = weld2.Part0.CFrame:ToObjectSpace(weld2.Part1.CFrame)
        weld2.Parent = weld2.Part0
    end)
end)
0
This didn't work for some reason. I am getting the same error. The case is just above the legs on the left. (if that's what you mean) The * CFrame.new (0,0,-4) is just a test as I haven't figured out the exact position tumtindy 36 — 2y
0
Where does the egg parented to? AltairCelestia 47 — 2y

Answer this question