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.