It doesn’t detect the players humanoid to damage it (I need Region3 due to if the player doesn’t move .Touched wont register.
DevHub, and much more DevForum posts with no luck of help.
I am using a ServerScript and I am kind of making my own type of UTG Monster. (I am not making a UTG) but it doesn’t seem to be print the players Character (Can also be a dummy so I can’t do :GetPlayerFromCharacter)
-- The REGION
local Region = Region3.new(Vector3.new(6,0,6),Vector3.new(12,6,12))
local part = Instance.new("Part",workspace)
part.Anchored = true
part.Size = Region.Size
part.CanCollide = false
part.Position = MainMover.Position
-- The DAMAGING EVENT
coroutine.wrap(function()
while true do
local parts = workspace:FindPartsInRegion3(Region, part, 2000)
task.wait()
if ending == true then
break
end
for i,v in pairs(parts) do
if v.Parent:FindFirstChild("Humanoid") ~= nil then
print(v.Name)
local char = v.Parent
char.Humanoid.Health = 0
end
end
end
end)()
Also sorry for the code formatting Google broke it.
So that puts a new part into a CFrame and then it goes for the size then the parameters? (also if I wanna check if something touched it how would I get the OBJ like .touched)
Oh well its basically a region ( it gets all the parts currently touching it )
id do
local parts = game.Workspace:GetPartBoundsInBox(CFrame.new(),Vector3.new(1,1,1),overlap)
for i,v in pairs(parts) do
-- these are all of your parts that are touching the obj
end