Zevios
|
  |
| Joined: 14 Sep 2013 |
| Total Posts: 504 |
|
|
| 22 Jan 2017 02:59 PM |
while true do wait(0.01) if script.Parent.Velocity.magnitude > 0.1 then script.Parent.Engine:Play() script.Parent.Engine.PlaybackSpeed = 0.05 + script.Parent.Velocity.magnitude/260 else script.Parent.Engine:Stop() end end
Help is very very very much appreciated I still can't get it working after 5 days of trying |
|
|
| Report Abuse |
|
|
|
| 22 Jan 2017 03:01 PM |
| What's happening that you're not liking? |
|
|
| Report Abuse |
|
|
Zevios
|
  |
| Joined: 14 Sep 2013 |
| Total Posts: 504 |
|
|
| 22 Jan 2017 03:03 PM |
| The sound doesn't active but you hear 0.1 snaps of it every 5 seconds or so |
|
|
| Report Abuse |
|
|
|
| 22 Jan 2017 03:05 PM |
You're likely going to get a lot of feedback from this, but run your vehicle and make sure these numbers look right:
while true do wait(0.01) if script.Parent.Velocity.magnitude > 0.1 then script.Parent.Engine:Play() script.Parent.Engine.PlaybackSpeed = 0.05 + script.Parent.Velocity.magnitude/260 print(script.Parent.Engine.PlaybackSpeed); else script.Parent.Engine:Stop() end end |
|
|
| Report Abuse |
|
|
Zevios
|
  |
| Joined: 14 Sep 2013 |
| Total Posts: 504 |
|
|
| 22 Jan 2017 03:08 PM |
| AH WAIT I think the script makes the audio playback so much times that it doesn't sound. If I changed the wait to 5 seconds, the sound you can hear. BUT the property "pitch" is removed so i really don't know what to do! ## # #### playbackspeed instead |
|
|
| Report Abuse |
|
|
Zevios
|
  |
| Joined: 14 Sep 2013 |
| Total Posts: 504 |
|
|
| 22 Jan 2017 03:11 PM |
while true do wait(0.01) if script.Parent.Velocity.magnitude > 0.1 then script.Parent.Engine:Play()
"script.Parent.Engine:Play()"
so the audio keeps playing back itself every 0.01 second? |
|
|
| Report Abuse |
|
|
Zevios
|
  |
| Joined: 14 Sep 2013 |
| Total Posts: 504 |
|
| |
|
Zevios
|
  |
| Joined: 14 Sep 2013 |
| Total Posts: 504 |
|
| |
|
Zevios
|
  |
| Joined: 14 Sep 2013 |
| Total Posts: 504 |
|
| |
|
Zevios
|
  |
| Joined: 14 Sep 2013 |
| Total Posts: 504 |
|
| |
|
Zevios
|
  |
| Joined: 14 Sep 2013 |
| Total Posts: 504 |
|
| |
|
RogueMage
|
  |
| Joined: 28 Jan 2012 |
| Total Posts: 1235 |
|
|
| 23 Jan 2017 11:13 AM |
| Check if the sound is already playing. If it isn't, then play it. If it is, then don't. ############# ## a property of Sounds and returns a boolean based on whether it's playing or not. |
|
|
| Report Abuse |
|
|
RogueMage
|
  |
| Joined: 28 Jan 2012 |
| Total Posts: 1235 |
|
| |
|
RogueMage
|
  |
| Joined: 28 Jan 2012 |
| Total Posts: 1235 |
|
|
| 23 Jan 2017 11:14 AM |
| http://wiki.roblox.com/index.php?title=API:Class/Sound/Playing |
|
|
| Report Abuse |
|
|