hey guys i am having trouble with this simple door script
debounce = false
function onTouch(obj)
if debounce then return
end
if obj.Parent == nil then return
end
if Players:playerFromCharacter(obj.Parent) == nil
then return
end
debounce=true
script.Parent.Transparency=0.9
script.Parent.CanCollide= false
wait(2)
script.Parent.Transparency=0
script.Parent.CanCollide=true
debounce = false
end
script.Parent.Touched:connect(onTouch)
i am very new to scipting, 1st week, does it matter what name i put the brick as and also i put this script under the brick i want this to do it to if it matters

2 comments
thanks codecakes but what do you mean by define players and what does the last line do the "script.Parent.Touched:connect(onTouch)"...im learning off of roblox wiki but it seems rather vague in explaining thing
playerFromCharacter is a member of the Players service. It does the same thing as GetPlayerFromCharacter. Please modify your answer to include this.