I want to make a block where whenever your touching it, it gives you a forcefield but when you get off of the block it goes away, this is my code
local forcePart = script.Parent local canActivate = true local function forceField(otherPart) local humanoid = otherPart.Parent:FindFirstChild('Humanoid') if humanoid and canActivate then canActivate = false forcePart.Transparency = 1 forcePart.CanCollide = false local force = Instance.new('ForceField') force.Parent = humanoid.Parent wait(5) forcePart.Transparency = 0 forcePart.CanCollide = true force:Destroy() canActivate = true end end forcePart.Touched:Connect(forceField)
My guess would be because you disable the part's collision which causes it to fall through the map, If you don't have to move it you should anchor the part.