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
playerFromCharacter
isn't a valid method. I believe your looking for GetPlayerFromCharacter. You also forgot to define "player" on line 8.
debounce = false players = game.Players --You forgot to define "players" function onTouch(obj) if debounce then return end if obj.Parent == nil then return end if players:GetPlayerFromCharacter(obj.Parent) == nil --Changed to GetPlayerFromCharacter 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)