Can i put get children in this script?

I was just wondering if I can incorporate GetChildren in this script to find the children of Map1 somehow and if so, how?

if Result and Result.Instance:IsDescendantOf(workspace:FindFirstChild("Map1"))

What are you trying to accomplish with this script? Your goal will inform what methods you use and how you use each one. Could you give me a little bit more detail on what you want this script to do and then I can help you figure out how to go about it?

:IsDescendantOf(workspace:FindFirstChild(“Map1”) should return true as long as map is an ancestor of the part, so you shouldn’t have to find the map’s children as well. Unless you meant to do something else with the script?

I’m trying to raycast the players position when a map spawns in from server storage into workspace. So then the player moves with the map with tweening service and so the player can walk around on buildings and stuff on those maps when it is being tweened.

local Players = game:GetService("Players")
local player = game.Players.LocalPlayer
local RunService = game:GetService('RunService')

local LastPartCFrame
local Raycastparams = RaycastParams.new()
Raycastparams.FilterType = Enum.RaycastFilterType.Blacklist
Raycastparams.FilterDescendantsInstances = {player.Character or player.CharacterAdded:Wait()}

RunService.Heartbeat:Connect(function()
	if not player.Character or not player.Character:FindFirstChild("HumanoidRootPart") then
		return
	end

	local RootPart = player.Character.HumanoidRootPart
	
	local Result = workspace:Raycast(RootPart.Position, Vector3.new(0,-50,0), Raycastparams)
	
	if Result and Result.Instance:IsDescendantOf(workspace:FindFirstChild("Map1"))
		
		
		
		
		
		
	then  
		
		
		
		local Floor = Result.Instance
		if LastPartCFrame == nil then 
			LastPartCFrame = Floor.CFrame 
		end
		local PartCF = Floor.CFrame 
		
		local Rel = PartCF * LastPartCFrame:inverse()
		
		LastPartCFrame = Floor.CFrame 
		
		RootPart.CFrame = Rel * RootPart.CFrame 
		
	else
		LastPartCFrame = nil 
		
	end
end)

player.CharacterAdded:Connect(function()
	Raycastparams.FilterDescendantsInstances = player.Character
end)

basically the player does move with the tweened map on the main ground floor part, where the building models are placed on top of, however, as soon as the player tries to enter a building that is welded to the main ground floor part, the player gets randomly teleported somewhere else. I think it’s due to some kind of CFrame or raycasting issue.