Error with "Chasing" dummy

You can write your topic however you want, but you need to answer these questions:

  1. What do you want to achieve? Keep it simple and clear!
    I’m attempting to get the dummy to still chase the player even when blocking

  2. What is the issue? Include screenshots / videos if possible!
    I’m trying to add some logic to the “if” statement to detect if their not hittable but blocking and if not, if they are hittable and not blocking
    and i keep getting the error
    “20:56:38.786 Blocking is not a valid member of Folder “Workspace.GodDummy.PlayerINFO” - Server - BasicChase:32”

  3. What solutions have you tried so far? Did you look for solutions on the Developer Hub?
    ive tried making it a variable, as shown in the code block, ive also tried printing it and the print worked fine, but strangley ONLY when using FindFirstChild() and not Example.Child

After that, you should include more details if you have any. Try to make your topic as descriptive as possible, so that it’s easier for people to help you!


local char = script.Parent
local hum = char:WaitForChild("Humanoid")
local hrp = char:WaitForChild("HumanoidRootPart")
local loop = true
local rootPart = char.HumanoidRootPart
local plrs = game:GetService("Players")
local distance = 9999999 

char.HumanoidRootPart:SetNetworkOwner(nil)

local function followPath()

	local goal
	local function findTarget()
		local nearestDistance = math.huge
		local nearestPlayer = nil
		for _,ePlayer in pairs(game.Workspace:GetChildren()) do
			if ePlayer and ePlayer ~= char and ePlayer:FindFirstChildOfClass("Humanoid") and ePlayer:FindFirstChild("HumanoidRootPart") and ePlayer:FindFirstChild("PlayerINFO") and ePlayer:FindFirstChild("PlayerINFO"):FindFirstChild("CanBeHit") then
				if ePlayer:FindFirstChildOfClass("Humanoid").Health > 0 then
					local blocking = ePlayer.PlayerINFO.Blocking
					if  ePlayer:FindFirstChild("PlayerINFO"):FindFirstChild("CanBeHit").Value == true and blocking.Value == false or ePlayer:FindFirstChild("PlayerINFO"):FindFirstChild("CanBeHit").Value == false and blocking.Value == true then -- This is the line cause all the issues
						

						local distance = (ePlayer.HumanoidRootPart.Position - hrp.Position).Magnitude
						if distance < nearestDistance then
							nearestDistance = distance
							nearestPlayer = ePlayer
						end
						end
						
						
					


				end

			end
		end

		return nearestPlayer
	end
	if findTarget() then
		goal = findTarget().HumanoidRootPart
		hum:MoveTo(goal.Position)
	end
end


while task.wait() do
	if loop then

		followPath()
	end
end

location of the “Blocking” value
image_2024-07-01_210658847

location of the chase script (BasicChase)
image_2024-07-01_210809438

If you require more information, do ask.
and apologies if i messed something up

Please do not ask people to write entire scripts or design entire systems for you. If you can’t answer the three questions above, you should probably pick a different category.

1 Like

I’d try putting the PlayerINFO folder in the Player rather than the Character, as I’ve ran into these types of problem before. Just make sure to reset the values when the player dies, and that the values can’t be changed while the player is dead.

Edit: if you’re talking about the dummy thats having the problem, try putting it in ReplicatedStorage or somewhere that isn’t the character and create a “key” (folder, value) that is an object value or has the name of the dummy if you have multiple

1 Like

I think it may have also may have been caused by my own stupidity, i think i just forgot to put the required values into the folder of other characters (it also goes for other characters/dummys)
but now it just ignores the player when blocking instead of still chasing, so fixed one issue, now i have another, ill reply back if i find the issue

2 Likes

and sorry to reply twice, but it just strangley started to work for no reason
i literally just presed play to review the error and it worked, nothing changed

so i guess roblox and my own stupidity was my issue, but thank you for replying

2 Likes