miz656
|
  |
| Joined: 19 Jul 2010 |
| Total Posts: 15336 |
|
|
| 02 Aug 2011 10:55 PM |
Honestly, I literally don't know whats wrong with this function
function onTouched(Part) Game.Workspace.Touchtoopen.Head.Transparency = 0 Game.Workspace.Touchtoopen.Head.CanCollide = true wait(2) Game.Workspace.Touchtoopen.Head.Transparency = .6 Game.Workspace.Touchtoopen.Head.CanCollide = false end script.Parent.Touched:connect (onTouched)
I mean I'm sure I spelled everything write, and where it says Touchtoopen is the model name.But I don't know whats wrong with this |
|
|
| Report Abuse |
|
|
miz656
|
  |
| Joined: 19 Jul 2010 |
| Total Posts: 15336 |
|
| |
|
Ulla42
|
  |
| Joined: 14 Dec 2009 |
| Total Posts: 1774 |
|
|
| 02 Aug 2011 11:07 PM |
| try making Game lowercase, ex: game |
|
|
| Report Abuse |
|
|
miz656
|
  |
| Joined: 19 Jul 2010 |
| Total Posts: 15336 |
|
|
| 02 Aug 2011 11:11 PM |
That didnt work. DO you think it didnt work because I have 2 of the Touchtoopen in my game. Do you think thats why? |
|
|
| Report Abuse |
|
|
Ulla42
|
  |
| Joined: 14 Dec 2009 |
| Total Posts: 1774 |
|
| |
|
miz656
|
  |
| Joined: 19 Jul 2010 |
| Total Posts: 15336 |
|
| |
|
miz656
|
  |
| Joined: 19 Jul 2010 |
| Total Posts: 15336 |
|
|
| 02 Aug 2011 11:28 PM |
| And the weird thing is when I touch it its transparent but the CanCollide is still true and the weirder thing is the waits dont work.What I mean is the brick is transparent forever until I touch it again |
|
|
| Report Abuse |
|
|
scepile3
|
  |
| Joined: 27 Feb 2009 |
| Total Posts: 260 |
|
|
| 03 Aug 2011 12:04 AM |
First off, what's the brick's original properties? (before you touch it)
Secondly, you're going to need to add some prints. Putting one after the wait line lets you know if the wait actually worked. |
|
|
| Report Abuse |
|
|
miz656
|
  |
| Joined: 19 Jul 2010 |
| Total Posts: 15336 |
|
|
| 03 Aug 2011 12:14 AM |
Ok, the properties are all checked(Anchored,CanCollide,andarchivable)exept locked isnt checked at the beginning.
for the second what do I say?print what? |
|
|
| Report Abuse |
|
|
Ulla42
|
  |
| Joined: 14 Dec 2009 |
| Total Posts: 1774 |
|
| |
|
miz656
|
  |
| Joined: 19 Jul 2010 |
| Total Posts: 15336 |
|
|
| 03 Aug 2011 12:26 AM |
| im pretty sure that wouldn't work -_- |
|
|
| Report Abuse |
|
|
Spectrumw
|
  |
| Joined: 04 Aug 2009 |
| Total Posts: 13510 |
|
|
| 03 Aug 2011 12:36 AM |
Game.Workspace.Touchtoopen.Head.Transparency = 0 Game.Workspace.Touchtoopen.Head.CanCollide = true -- Isn't this supposed to be false? |
|
|
| Report Abuse |
|
|
miz656
|
  |
| Joined: 19 Jul 2010 |
| Total Posts: 15336 |
|
|
| 03 Aug 2011 12:43 AM |
| umm..No?Because the transparency is .6 when the transparency is 0 the CanCollide is true |
|
|
| Report Abuse |
|
|
|
| 03 Aug 2011 09:09 AM |
script.Parent.Touched:connect(function() workspace.Touchtoopen.Head.Transparency = 0 workspace.Touchtoopen.Head.CanCollide = true wait(2) workspace.Touchtoopen.Head.Transparency = .6 workspace.Touchtoopen.Head.CanCollide = false end)
Try that. Also, sometimes .Touched events error in solo mode, so test it in online mode. |
|
|
| Report Abuse |
|
|
|
| 03 Aug 2011 09:17 AM |
script.Parent.Touched:connect(function() workspace.Touchtoopen.Head.Transparency = 0 workspace.Touchtoopen.Head.CanCollide = false--Opened wait(2) workspace.Touchtoopen.Head.Transparency = .6 workspace.Touchtoopen.Head.CanCollide = true--Closed end)
|
|
|
| Report Abuse |
|
|
| |
|
Fredfishy
|
  |
| Joined: 21 Mar 2009 |
| Total Posts: 4197 |
|
|
| 03 Aug 2011 09:19 AM |
function onTouched(hit) Workspace.Touchtoopen.Head.Transparency = 0 Workspace.Touchtoopen.Head.CanCollide = true wait(2) Workspace.Touchtoopen.Head.Transparency = 0.6 Workspace.Touchtoopen.Head.CanCollide = false end
script.Parent.Touched:connect(onTouched)
Do you want it to open when touched? If so, try
function onTouched(hit) Workspace.Touchtoopen.Head.Transparency = 0.6 Workspace.Touchtoopen.Head.CanCollide = false wait(2) Workspace.Touchtoopen.Head.Transparency = 0 Workspace.Touchtoopen.Head.CanCollide = true end
script.Parent.Touched:connect(onTouched) |
|
|
| Report Abuse |
|
|
|
| 03 Aug 2011 09:21 AM |
Mikel, 0 transparency means you can't see through the door >.>
Fred, what's the difference between that and his original script? |
|
|
| Report Abuse |
|
|
|
| 03 Aug 2011 09:22 AM |
you could do...
local Object = Workspace.Touchtoopen.Head
script.Parent.Touched:connect(function() Object.Transparency = 0 Object.CanCollide = false--Opened wait(2) Object.Transparency = .6 Object.CanCollide = true--Closed end)
Cant reply to this post :D | | v
|
|
|
| Report Abuse |
|
|
|
| 03 Aug 2011 09:22 AM |
Mikel, that's just a unnessissary variable T.T
~I still posted, what now~ |
|
|
| Report Abuse |
|
|
Fredfishy
|
  |
| Joined: 21 Mar 2009 |
| Total Posts: 4197 |
|
|
| 03 Aug 2011 09:24 AM |
@dark I just rewrote it. Sometimes that fixes it for me.
The difference between the first and second of my scripts is that the first closes then opens and the second opens then closes. |
|
|
| Report Abuse |
|
|
|
| 03 Aug 2011 09:24 AM |
@dark oh you're right, It should be
local Object = Workspace.Touchtoopen.Head
script.Parent.Touched:connect(function() Object.Transparency = 0.6 Object.CanCollide = false--Opened wait(2) Object.Transparency = 0 Object.CanCollide = true--Closed end)
Cant Reply to this one either :D
| | v |
|
|
| Report Abuse |
|
|
|
| 03 Aug 2011 09:25 AM |
| @Fred, I'm pretty sure the error is just solo mode. .Touched scripts error all the time for me in solo mode :o |
|
|
| Report Abuse |
|
|
|
| 03 Aug 2011 09:26 AM |
@dark not unessicary, It makes it shorter thus, (possibly), lowering lag by a nth degree.
~What now, cant reply~
| | v |
|
|
| Report Abuse |
|
|
| |
|