-
Notifications
You must be signed in to change notification settings - Fork 0
/
SoundManager.lua
34 lines (33 loc) · 1.04 KB
/
SoundManager.lua
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
local train = workspace.Train.BogeyTest
local trainA = workspace.Train.BogeyONE
local train1 = workspace.Train.TrainC2.BogeyONE
local train1A = workspace.Train.TrainC2.BogeyTest
-----
local RS = game:GetService("ReplicatedStorage")
-----
local lon = RS:WaitForChild("LightsOn") --
local lof = RS:WaitForChild("LightsOff") --
local fwd = RS:WaitForChild("Fwd") --
local rwd = RS:WaitForChild("Rwd") --
local up = RS:WaitForChild("Up")
local dn = RS:WaitForChild("Down")
local eb = RS:WaitForChild("EB") --
local ho = RS:WaitForChild("Horn") --
-----
wait(5)
local function playKm() -- plays the km sound
workspace.Seat.Lights.TimePosition = 0
workspace.Seat.KM.Playing = true
wait(0.425)
workspace.Seat.KM.Playing = false
end
fwd.OnServerEvent:Connect(playKm)
rwd.OnServerEvent:Connect(playKm)
local function playLights() -- plays the light tumbler sound
workspace.Seat.Lights.TimePosition = 0
workspace.Seat.Lights.Playing = true
wait(0.298)
workspace.Seat.Lights.Playing = false
end
lon.OnServerEvent:Connect(playLights)
lof.OnServerEvent:Connect(playLights)