Help to fix script

hello everyone, I made a protection zone and when I did, I always appear on the roof of the building to help fix it, even spawn on the ground did not help

 function whentouchedOn(hit)
if not hit.Parent:FindFirstChild("Humanoid") then return end
if hit.Parent:FindFirstChild("ForceField") then return end
Instance.new("ForceField", hit.Parent)
end
  script.Parent.Touched:Connect(whentouchedOn)

 function whentouchedOff(hit)
if not hit.Parent:FindFirstChild("Humanoid") then return end
if hit.Parent:FindFirstChild("ForceField") then
	hit.Parent.ForceField:Destroy()
end
 end
 script.Parent.TouchEnded:Connect(whentouchedOff)
 local center = game.Workspace.SpawnLocation

another??? :sob:

check the highlighted bits, they show useful info

what do you mean? what are the highlighted ones?

I am not sure but try

script.Parent.Touched:Connect(function(hit)
	if hit.Parent:FindFirstChild("HumanoidRootPart") then
		Instance.new("ForceField", hit.Parent.HumanoidRootPart)
	end
end)

script.Parent.TouchEnded:Connect(function(hit)
	if hit.Parent.HumanoidRootPart:FindFirstChild("ForceField") then
		hit.Parent.HumanoidRootPart.ForceField:Destroy()
	end
end)

local center = game.Workspace.SpawnLocation

it didn’t work I’m still showing up on the roof but thanks for the help