FindPartsinRegion3 is not a valid member of Workspace "Workspace"

I don’t understand why it’s saying this, is it trying to see that the built-in function doesn’t belong in Workspace? . . I’m very confused, and I want to be able to properly scan the region for parts and put everything into a table.

Does anyone know what I could do? . . Here’s my server script

-- Variables --
local Remote = game.ReplicatedStorage.Practice


-- Script --

Remote.OnServerEvent:Connect(function(Player)

	print ("You've now reached the server, get hyped.")

	local Pos = Player.Character.HumanoidRootPart.CFrame*CFrame.new(0,0,-3).p
	local Size = Vector3.new(2,2,2)


	local Hitbox = Region3.new(Pos-Size,Pos+Size)
	print (Hitbox.Size, " | ", Hitbox.CFrame)

	local Enemies = workspace:FindPartsinRegion3(Hitbox,nil,20)

	print (Enemies)

end)

ERROR

16:56:22.935 FindPartsinRegion3 is not a valid member of Workspace “Workspace” - Server - Script:18
16:56:22.935 Stack Begin - Studio
16:56:22.935 Script ‘ServerScriptService.Script’, Line 18 - Studio - Script:18
16:56:22.936 Stack End - Studio

You have a slight typo. It’s FindPartsInRegion3(Hitbox,nil,20), not FindPartsinRegion3(Hitbox,nil,20).

1 Like