Hey, i'm in need of a brick that hurts a player when and ONLY when the PLAYER is INSIDE of the brick. Kind of like a hurting fog; but, i do not want the user to die immediately, i want them to just receive pain until left the INSIDE of the brick. Thanks!
Something like this might work inside the part:
local function CreateRegion3FromLocAndSize(Position, Size) local SizeOffset = Size/2 local Point1 = Position - SizeOffset local Point2 = Position + SizeOffset return Region3.new(Point1, Point2) end local reg = CreateRegion3FromLocAndSize(script.Parent.Position,script.Parent.Size) while wait(1) do local parts = workspace:FindPartsInRegion3(reg,script.Parent,math.huge) for i,v in pairs(parts) do if v and v.Name == "HumanoidRootPart" and v.Parent:FindFirstChild("Humanoid") then v.Parent.Humanoid:TakeDamage(5) --change for damage end end end