local part = script.Parent
part.Touched:Connect(function(hit)
local H = hit.Parent:FindFirstChild("Humanoid")
if H ~= nil then
print("player is in")
end
end)
part.TouchEnded:Connect(function(hitended)
local H = hitended.Parent:FindFirstChild("Humanoid")
if H ~= nil then
print("player is not in")
end
end)
if I touched the part and not moving it prints "player is in" and "player is not in" I don't know how to fix the problem also if I moved it spams "player is in" and "player is not in" I don't know if touchedended and touched is working! please Help!

3 comments
If it doesn't work, please tell me, as I might have forgotten some things in the script.
Ain't working :C
I see, let me edit the answer a bit