I have a brick that gives the player a permanent forcefield when they touch it, which works just fine. However, once I add the line of code to turn it invisible, that being forceField.Visible = false, the script no longer works. If I take the line out, it works again. This is the code I have:
local debounce = false
function onTouched(part)
local h = part.Parent:findFirstChild("Humanoid")
if h~=nil and debounce == false then
debounce = true
Field = Instance.new("ForceField")
forceField.Visible = false
Field.Parent = part.Parent
wait(4)
debounce = false
end
end
if (script.Parent ~= nil) and (script.Parent.className == "Part") then
connection = script.Parent.Touched:connect(onTouched)
end

4 comments
Check output for errors, if there are none it's working or not running. Also use the code block format when posting code.
This is because forceField is not defined.
Why are you using parenthesis on line 14? Also, the property is called ClassName, not className, although I recommend using IsA() anyway. Next, you should be using FindFirstChild, not findFirstChild. On line 4, you can use "if not debounce then" to check if debounce is false. Finally, you should be using Connect, not connect. Please refrain from using deprecated code as it is a bad practice.
As INOOBE_YT said, forceField is not defined. You defined the ForceField as Field, so you should be using that variable to set its visibility. Replace line 7 with "Field.Visible = false".