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

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

Asked by 5 years ago
Edited 5 years ago

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)
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. dpark19285 375 — 5y
0
how do I fix this and I know nothing about Scripts lol mrbong011 -5 — 5y

Closed as Non-Descriptive by User#19524

This question has been closed because its title or content does not adequately describe the problem you are trying to solve.
Please ensure that your question pertains to your actual problem, rather than your attempted solution. That is, you were trying to solve problem X, and you thought solution Y would work, but instead of asking about X when you ran into trouble, you asked about Y.

Why was this question closed?

1 answer

Log in to vote
0
Answered by
green271 635 Moderation Voter
5 years ago

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

Ad