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

Output saying Config is not a valid member of Datamodel?

Asked by 5 years ago

Yeah, this is bugging me and I am stumped.

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

"Config is not a valid member of Datamodel"

Model hierarchy is, https://gyazo.com/eeb5c723aae89620e92624f2c5b866e7

Here's my code below:

--ServerScript--
local Vehicle = hit.Parent.Parent.Config:FindFirstChild("Health")

    if Vehicle then
        Vehicle.Value = Vehicle.Value - 50
        end
    end

Any help would greatly be appreciated.

0
what is hit supposed to be? aazkao 787 — 5y
1
hit.Parent is Workspace, meaning hit.Parent.Parent is the DataModel, or game. User#19524 175 — 5y
0
local hit, position = game.Workspace:FindPartOnRay(ray, user) Decimaprism 65 — 5y
0
Ive also changed the hit.Parent around many times to try find the Config folder and ive gotten many different outputs. Decimaprism 65 — 5y

Answer this question