Right now i am making a sandstorm for my Egypt Area, but when trying to play the wind sound for when the sand storm starts, the sound plays or doesn’t play and my studio just crashed when testing the untouched part.
I have 2 scripts to control the SandStorm.
First Script is a local script in StarterGui and it is the one that has problems with sound playing. (To Make This a Little Bit Easier to find out where the problem is anything that Mentions Wind, Below the first 3 wind mentions, is the part that i am confused at).
local RS = game:GetService("ReplicatedStorage")
local REs = RS:WaitForChild("REs")
local rE = REs:WaitForChild("SandStorm")
local plr = game:GetService("Players").LocalPlayer
local Storms = game.Workspace.SandStorm
local Wind = script.Sound
local WindEnder = game.Workspace.SandStorm.WindEnder
local WindStarter = game.Workspace.SandStorm.WindStarter
local SandStorm1 = Storms.SandStorm1
local SandStorm1Models1 = SandStorm1.One
local SandStorm1Models2 = SandStorm1.Two
local SandStorm1Models3 = SandStorm1.Three
local SandStorm1Models4 = SandStorm1.Four
local SandStorm1Parts1 = SandStorm1Models1.SandstormBrick1
local SandStorm1Parts2 = SandStorm1Models1.SandstormBrick2
local SandStorm1Parts3 = SandStorm1Models1.SandstormBrick3
local SandStorm1Parts4 = SandStorm1Models1.SandstormBrick4
local SandStorm1Models2Parts1 = SandStorm1Models2.SandstormBrick1
local SandStorm1Models2Parts2 = SandStorm1Models2.SandstormBrick2
local SandStorm1Models2Parts3 = SandStorm1Models2.SandstormBrick3
local SandStorm1Models2Parts4 = SandStorm1Models2.SandstormBrick4
local SandStorm1Models3Parts1 = SandStorm1Models3.SandstormBrick1
local SandStorm1Models3Parts2 = SandStorm1Models3.SandstormBrick2
local SandStorm1Models3Parts3 = SandStorm1Models3.SandstormBrick3
local SandStorm1Models3Parts4 = SandStorm1Models3.SandstormBrick4
local SandStorm1Models4Parts1 = SandStorm1Models4.SandstormBrick1
local SandStorm1Models4Parts2 = SandStorm1Models4.SandstormBrick2
local SandStorm1Models4Parts3 = SandStorm1Models4.SandstormBrick3
local SandStorm1Models4Parts4 = SandStorm1Models4.SandstormBrick4
local SandStorm1Smoke1 = SandStorm1Parts1.Sandstormbrick
local SandStorm1Smoke2 = SandStorm1Parts2.Sandstormbrick
local SandStorm1Smoke3 = SandStorm1Parts3.Sandstormbrick
local SandStorm1Smoke4 = SandStorm1Parts4.Sandstormbrick
local SandStorm1Models2Smoke1 = SandStorm1Models2Parts1.Sandstormbrick
local SandStorm1Models2Smoke2 = SandStorm1Models2Parts2.Sandstormbrick
local SandStorm1Models2Smoke3 = SandStorm1Models2Parts3.Sandstormbrick
local SandStorm1Models2Smoke4 = SandStorm1Models2Parts4.Sandstormbrick
local SandStorm1Models3Smoke1 = SandStorm1Models3Parts1.Sandstormbrick
local SandStorm1Models3Smoke2 = SandStorm1Models3Parts2.Sandstormbrick
local SandStorm1Models3Smoke3 = SandStorm1Models3Parts3.Sandstormbrick
local SandStorm1Models3Smoke4 = SandStorm1Models3Parts4.Sandstormbrick
local SandStorm1Models4Smoke1 = SandStorm1Models4Parts1.Sandstormbrick
local SandStorm1Models4Smoke2 = SandStorm1Models4Parts2.Sandstormbrick
local SandStorm1Models4Smoke3 = SandStorm1Models4Parts3.Sandstormbrick
local SandStorm1Models4Smoke4 = SandStorm1Models4Parts4.Sandstormbrick
SandStorm1Smoke1.Enabled = false
SandStorm1Smoke2.Enabled = false
SandStorm1Smoke3.Enabled = false
SandStorm1Smoke4.Enabled = false
SandStorm1Models2Smoke1.Enabled = false
SandStorm1Models2Smoke2.Enabled = false
SandStorm1Models2Smoke3.Enabled = false
SandStorm1Models2Smoke4.Enabled = false
SandStorm1Models3Smoke1.Enabled = false
SandStorm1Models3Smoke2.Enabled = false
SandStorm1Models3Smoke3.Enabled = false
SandStorm1Models3Smoke4.Enabled = false
SandStorm1Models4Smoke1.Enabled = false
SandStorm1Models4Smoke2.Enabled = false
SandStorm1Models4Smoke3.Enabled = false
SandStorm1Models4Smoke4.Enabled = false
WindStarter.Touched:Connect(function(windstart)
WindStarter.TouchEnded:Connect(function(windend)
WindEnder.Touched:Connect(function(windend2)
WindEnder.TouchEnded:Connect(function(windend3)
rE.OnClientEvent:Connect(function(mode)
if mode == "Start" then
SandStorm1Smoke1.Enabled = true
SandStorm1Smoke2.Enabled = true
SandStorm1Smoke3.Enabled = true
SandStorm1Smoke4.Enabled = true
SandStorm1Models2Smoke1.Enabled = true
SandStorm1Models2Smoke2.Enabled = true
SandStorm1Models2Smoke3.Enabled = true
SandStorm1Models2Smoke4.Enabled = true
SandStorm1Models3Smoke1.Enabled = true
SandStorm1Models3Smoke2.Enabled = true
SandStorm1Models3Smoke3.Enabled = true
SandStorm1Models3Smoke4.Enabled = true
SandStorm1Models4Smoke1.Enabled = true
SandStorm1Models4Smoke2.Enabled = true
SandStorm1Models4Smoke3.Enabled = true
SandStorm1Models4Smoke4.Enabled = true
if windstart then
if Wind.IsPaused then
Wind:Play()
Wind.Looped = true
print("In Area For Wind Started Wind")
end
end
if not windstart then
print("Not In Area For Wind")
end
if windend or windend2 or windend3 then
Wind:Pause()
print("Out Of Area For Wind Stopped Wind")
end
else
if Wind.IsPlaying then
Wind:Stop()
print("SandStorm Stopped Ending Wind")
end
SandStorm1Smoke1.Enabled = false
SandStorm1Smoke2.Enabled = false
SandStorm1Smoke3.Enabled = false
SandStorm1Smoke4.Enabled = false
SandStorm1Models2Smoke1.Enabled = false
SandStorm1Models2Smoke2.Enabled = false
SandStorm1Models2Smoke3.Enabled = false
SandStorm1Models2Smoke4.Enabled = false
SandStorm1Models3Smoke1.Enabled = false
SandStorm1Models3Smoke2.Enabled = false
SandStorm1Models3Smoke3.Enabled = false
SandStorm1Models3Smoke4.Enabled = false
SandStorm1Models4Smoke1.Enabled = false
SandStorm1Models4Smoke2.Enabled = false
SandStorm1Models4Smoke3.Enabled = false
SandStorm1Models4Smoke4.Enabled = false
end
end)
end)
end)
end)
end)
Second Script that is is ServerScriptService (The one that starts the SandStorm and end the SandStorm) (It has a wait(30)
because i was testing it.)
local RS = game:GetService("ReplicatedStorage")
local REs = RS:WaitForChild("REs")
local rE = REs:WaitForChild("SandStorm")
while true do
wait(30)
print("Starting SandStorm")
rE:FireAllClients("Start")
wait(120)
print("Ending SandStorm")
rE:FireAllClients("Stop")
end