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

"Config" is not a valid member of Data Model?

Asked by 5 years ago
Edited 5 years ago

Yeah, this is bugging me and I am stumped. Ive posted twice previously to this and still haven't been able to figure it out.

Just trying to find the IntValue of Health and the error pops up as,

"Config is not a valid member of Datamodel"

Here is my code, its really simple,

local user = tool.Parent 
local ray = Ray.new(tool.MuzzleFlash.CFrame.p, (target - tool.MuzzleFlash.CFrame.p).unit*300)local hit, position = game.Workspace:FindPartOnRay(ray, user)

local TargetObj = hit.Parent.Parent.Config:FindFirstChild("Health")
print (TargetObj)
if TargetObj ~= nil then 
    TargetObj.Value = TargetObj.Value - 25
end

Most times it will find the value and take out the 25, however, it also still refers back to "Config is not a valid member of data model" despite finding it once and awhile. Also will say Config is not a valid member of Workspace.

This is the Hierarchy: https://gyazo.com/aa543356dd9f08c552641cc1f516608e

The errors just really bug me and I'm stumped. Any help again would be appreciative.

0
I have tried hit.Parent.Config:FindFirstChild("Health"), dosent work...Super stumped. Decimaprism 65 — 5y
0
When it tells you that's because there is no config brok4d 77 — 5y
0
theres no child called "config" in your model User#23365 30 — 5y

1 answer

Log in to vote
0
Answered by
Launderer 343 Moderation Voter
5 years ago

in that screenshot you have nothing named "Config"

Ad

Answer this question