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

can someone help me with this error contents is not a valid member of Model ?

10:22:04.761 - contents is not a valid member of Model 10:22:04.762 - Stack Begin 10:22:04.762 - Script 'Workspace.Euro Dealership.AntiLag.system_operation', Line 4 10:22:04.763 - Stack End

repeat wait() until script.Parent.Parent.Parent.Parent.Parent.Parent.Parent.Parent.Name ~= "Head"
Debounce = false
**
Player = script.Parent.Parent.Parent.Parent.Parent.Parent.Parent.Parent.Parent
Price = script.Parent.Parent.Parent:FindFirstChild("PriceValue")
Gun = script.Parent.Parent.Parent.Parent:FindFirstChild("Gun")

script.Parent.MouseButton1Click:connect(function()
	if Debounce == false and Player.Character:FindFirstChild("Money").Value >= Price.Value then
	Player.Character:FindFirstChild("Money").Value = Player.Character:FindFirstChild("Money").Value - Price.Value	
	wait()
	game.ServerStorage.Weapons:FindFirstChild(Gun.Text):clone().Parent = Player.Backpack
	end
	
end)

2 comments

0

Give us some code to work with. Most likely, the problem is that there is no object named "contents" inside whatever "Model" is referring to.

0

how do I fix this and I know nothing about Scripts lol

1 answer

You didn't give us any code to work with but there are some solutions you can try:

  1. Make sure you have an object named "Contents" in your model that you're referring to
  2. If you do have the contents object, then doing system:WaitForChild("Contents")
  3. Check your scripts to make sure you aren't changing the parent or destroying the "Contents" object

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