Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

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

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

✓ Accepted answer

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.

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

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)

2 comments

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

0

Where does the egg parented to?

This discussion is preserved as it was. New answers, comments, and votes are closed.