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

Can somebody tell me whats wrong with my code?

Please help

local DL = script.Parent.sdsd

Game.Workspace.k.Teknikk.DoorSensorInn.Sensor.Touched:connect(function(p)
	if p~= nil then
		for L=1, #DL do
			DL[L].Transparency = "0.5"
			DL[L].CanCollide = true
		end
		wait(2)
		for L=1, #DL do
			DL[L].Transparency = "0"
			DL[L].CanCollide = false
		end
	end
end

2 answers

✓ Accepted answer

Here I rescripted your one, Put a part in the workspace called part.

local Door = script.Parent -- The part
function onTouch() -- When touched
	Door.CanCollide = False -- Walkthroughable
	Door.Transparency = 0.5 -- Transparent
	Door.BrickColor = BrickColor:Random() -- Changes colour (If you want, if not just remove this line and the other one)
	wait(2) -- waits 2 seconds
	Door.CanCollide = true -- Solid again
	Door.Transparency = 0 -- Opaque 
	Door.BrickColor = BrickColor:Random() -- Changes colour again (If not then remove this line too)
end
Door.Touched:connect(onTouch)

2 comments

0

Thanks :D

0

No problem!

Please explain what is this, What is does In more detail otherwise we don't know!

2 comments

0

When the sensor is touched by a humanoid it will make the part appear, then make it disappear after 2 seconds.

0

Ok

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