Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
1

How to make a door if a player holds a flashlight they can go throught a door?

Asked by
hokyboy 270 Moderation Voter
4 years ago
function onTouch(part) 
    if script.Parent.Parent:FindFirstChild("Flashlight")  -- i think the error line 
    then 
        game.Workspace.Door.CanCollide = false
    end 
end

script.Parent.Touched:connect(onTouch)

0
I think it would be better if when you equip your flashlight it can CanCollide = false by the client of course St_vnC 330 — 4y

1 answer

Log in to vote
1
Answered by 4 years ago

Just like this

game.Workspace.Door.Touched:Connect(function(hit)
if hit.Parent:FindFirstChild("Flashlight") then
game.Workspace.Door.CanCollide = false
0
Would recomend to fire a event so other can see it dr6g0nb0y 27 — 4y
Ad

Answer this question