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

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

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.

3 comments

0

I have tried hit.Parent.Config:FindFirstChild("Health"), dosent work...Super stumped.

0

When it tells you that's because there is no config

0

theres no child called "config" in your model

1 answer

in that screenshot you have nothing named "Config"

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