Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

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

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)

1 comment

0

I think it would be better if when you equip your flashlight it can CanCollide = false by the client of course

1 answer

✓ Accepted answer

Just like this

game.Workspace.Door.Touched:Connect(function(hit)
if hit.Parent:FindFirstChild("Flashlight") then
game.Workspace.Door.CanCollide = false

1 comment

0

Would recomend to fire a event so other can see it

This discussion is preserved as it was. New answers, comments, and votes are closed.