You can write your topic however you want, but you need to answer these questions:
-
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 -
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” -
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
location of the chase script (BasicChase)
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.