script.Parent.Touched:connect(function(hit) game.Workspace.Blocker1.CanCollide = true end)
really easy right? but the block's cancollide does not work it doesn't allow it to be collided with
CanCollide is already false i want it to be true though
script.Parent.Touched:connect(function(hit) if hit.Parent:FindFirstChild("Humanoid") then game.Workspace.Blocker1.CanCollide = true end end)
Its good to use FindFirstChild
because script.Parent
can be touched by anything and that can really mess things up!
You're setting CanCollide
to True
when you're supposed to make it False
.
script.Parent.Touched:connect(function() game.Workspace.Blocker1.CanCollide = false end)
True is the default value of Cancollide. If you want to go through it, then you want to set it to false.
This might help:
local Blocker = workspace:WaitForChild("Blocker1") Blocker.Touched:Connect(function(Touch) -- If the part is touched, it will connect a function to it. local Humanoid = Touch.Parent:FindFirstChild("Humanoid") -- This looks for a humanoid. if Humanoid ~= nil then - If there is a humanoid, do this: local Player = game.Players:GetPlayerFromCharacter(Humanoid.Parent) -- Looks for a player if Player ~= nil then -- If a player is found, it will set the parts' CanCollide property to false. Blocker.CanCollide = false end end end)