|
| 23 Aug 2011 08:26 PM |
In this CFrame door script, it's supposed to play the sound Tick for each time it repeats in "for i=1,14 do". For some reason it only plays when it is at it's original position. It moves correctly though. Could someone help?
debounce = false
function onTouch() if debounce then return end debounce = true wait(0.2) for i=1,14 do script.Parent.CFrame = script.Parent.CFrame - Vector3.new(0, 1, 0) script.Parent.Tick.Pitch = script.Parent.Tick.Pitch - 0.5 script.Parent.Tick:Play() wait(0.05) end wait(3) for i=1,14 do script.Parent.CFrame = script.Parent.CFrame + Vector3.new(0, 1, 0) script.Parent.Tick.Pitch = script.Parent.Tick.Pitch + 0.5 script.Parent.Tick:Play() wait(0.05) end debounce = false end
script.Parent.Touched:connect(onTouch)
|
|
|
| Report Abuse |
|
|
| |
|
nate890
|
  |
| Joined: 22 Nov 2008 |
| Total Posts: 21686 |
|
|
| 23 Aug 2011 08:46 PM |
Probably because it isn't playing at all.
The one that's playing is probably the one in workspace, and has nothing to do with the script.
Define 'Tick'
<'+1 Post. Ujelly?'> |
|
|
| Report Abuse |
|
|
nate890
|
  |
| Joined: 22 Nov 2008 |
| Total Posts: 21686 |
|
|
| 23 Aug 2011 08:47 PM |
Oh, didn't see that. >.<
<'+1 Post. Ujelly?'> |
|
|
| Report Abuse |
|
|
|
| 23 Aug 2011 08:49 PM |
| Script is inside of a Brick. |
|
|
| Report Abuse |
|
|
SDuke524
|
  |
| Joined: 29 Jul 2008 |
| Total Posts: 6267 |
|
|
| 23 Aug 2011 08:49 PM |
| I'm guessing this is an elevator? |
|
|
| Report Abuse |
|
|
|
| 23 Aug 2011 08:51 PM |
| try removing the line related to the sound pitch |
|
|
| Report Abuse |
|
|
|
| 23 Aug 2011 09:04 PM |
| Not an elevator. And I need the pitch change. The sound is supposed to mimic the sound a sliding up/down metal door from Zelda OOT. |
|
|
| Report Abuse |
|
|
| |
|
|
| 23 Aug 2011 09:23 PM |
Try removing the debounce?
~ www.roblox.com/--item?id=60008124 ~ |
|
|
| Report Abuse |
|
|
|
| 23 Aug 2011 09:25 PM |
| I need the debounce so it doesnt float off into space.. it moves fine. |
|
|
| Report Abuse |
|
|
| |
|
|
| 23 Aug 2011 09:46 PM |
| Could someone PLEASE tell me how to fix this? |
|
|
| Report Abuse |
|
|
SDuke524
|
  |
| Joined: 29 Jul 2008 |
| Total Posts: 6267 |
|
|
| 23 Aug 2011 09:55 PM |
| Maybe take the sound outside of the part and just group it with the part, being that the moving seems to be the problem. |
|
|
| Report Abuse |
|
|
|
| 23 Aug 2011 10:02 PM |
| No I tried that, but I put another brick right infront of it and put the sound inside of it instead, because I need the range of which you can hear it is liminted. Thus meaning it needs to be in a brick. Didn't work. |
|
|
| Report Abuse |
|
|
|
| 23 Aug 2011 10:03 PM |
| But of course I changed the directory of which the sound is in when I moved it. |
|
|
| Report Abuse |
|
|
nate890
|
  |
| Joined: 22 Nov 2008 |
| Total Posts: 21686 |
|
| |
|
|
| 23 Aug 2011 10:08 PM |
| Um. A blank post doesnt help..? |
|
|
| Report Abuse |
|
|
SDuke524
|
  |
| Joined: 29 Jul 2008 |
| Total Posts: 6267 |
|
|
| 23 Aug 2011 10:24 PM |
| I'm sorry I didn't notice this before but you have it doing the play method inside the loop, so have it before the loop and stop after the loop. |
|
|
| Report Abuse |
|
|
|
| 23 Aug 2011 10:38 PM |
| But it needs to play 14 times... AS the door is going up/down... |
|
|
| Report Abuse |
|
|
| |
|
SDuke524
|
  |
| Joined: 29 Jul 2008 |
| Total Posts: 6267 |
|
|
| 23 Aug 2011 10:42 PM |
Then after Wait(0.05) put
script.Parent.Tick:Stop() |
|
|
| Report Abuse |
|
|
|
| 23 Aug 2011 10:44 PM |
| Yeaa.. I tried that too already... |
|
|
| Report Abuse |
|
|
|
| 23 Aug 2011 10:45 PM |
| Lit, there is no output for this script. It doesnt see it as malfunctioning for some reason. |
|
|
| Report Abuse |
|
|
SDuke524
|
  |
| Joined: 29 Jul 2008 |
| Total Posts: 6267 |
|
| |
|