function onTouch(p)
local h = p.Parent:FindFirstChild("Humanoid")
if h then
local ff = p.Parent:findFirstChild("ForceField")
if h.Health == 100 and not ff then
Instance.new("ForceField", h.Parent)
script.Parent.TouchEnded:connect(function()
if ff then
Instance.new("ForceField", h.Parent):Destroy()
end
end)
end
end
end
script.Parent.Touched:connect(onTouch)
can someone please tell me why this isnt working

2 comments
Move the TouchEnded function out of the Touch function
I'm not new to scripting, i'm just really bad at it. Can you tell me where to put it?