of     1   

Cordop
#141060703Monday, July 21, 2014 3:31 PM GMT

Okay, so I've been testing out scripts recently in terms of me learning to script, and for some reason this script is failing. I cannot seem to find the problem with it, as it's worked with other things before. ((The script does not work in or out of the part, and will not work in the Command Bar. function onTouched(Touched) script.Parent.Parent.DoorPiece.CanCollide= false script.Parent.Parent.DoorPiece.Transparency= 0.4 wait(3) script.Parent.Parent.DoorPiece.CanCollide= true script.Parent.Parent.DoorPiece.Transparency= 0.0 end Help?
Toughlizard1345
#141061170Monday, July 21, 2014 3:39 PM GMT

script.Parent.Touched:connect(function(Touched) script.Parent.Parent.DoorPiece.CanCollide= false script.Parent.Parent.DoorPiece.Transparency= 0.4 wait(3) script.Parent.Parent.DoorPiece.CanCollide= true script.Parent.Parent.DoorPiece.Transparency= 0.0 end)
Cordop
#141061488Monday, July 21, 2014 3:43 PM GMT

Wouldn't script.Parent.Touched:connect(function(Touched) be a longer version of function onTouched(Touched)? ((Sorry if I sound like a noob about this, I just learned how to script, so, yeah....
Toughlizard1345
#141061620Monday, July 21, 2014 3:44 PM GMT

You have to have a connection like in the function. There are 2 ways of doing it. script.Parent.Touched:connect(function(Touched) --code end) or function onTouched(Touched) --code script.Parent.Touched:connect(onTouched)
Cordop
#141061766Monday, July 21, 2014 3:46 PM GMT

Ah! Thank you, that's what I was forgetting! I forgot the script.Parent.Touched:connect(onTouched)! Thank you so much! ((I'll see if it works later today, I'm going outside/Dollar General now. Intell Communication®
Cordop
#141063998Monday, July 21, 2014 4:13 PM GMT

Either one is wrong. "Touched is not a valid member of Workspace."
Cordop
#141064130Monday, July 21, 2014 4:14 PM GMT

Nevermind, forgot to place it into DoorPiece. Thank you so much.

    of     1