Hello devs! So I as the title says, sounds don’t play and there are not any errors this is the code (this is code for diffirent round types in my horror game) :
local ts = game:GetService("TweenService")
local colorTween = nil
local module = nil
script.Parent.Mode.Event:Connect(function(mode)
if workspace.Day.Value == false then
if workspace.Mode.Value == false then
workspace.Mode.Value = true
script.Parent.CanStun.Value = true
repeat task.wait() until script.Parent.StunMain.Stunned.Value == false
module = require(mode)
script.Parent.Configuration.RunSpeed.Value = module.Speed
script.Parent.Configuration.WalkSpeed.Value = module.Speed
script.Parent.Configuration.Damage.Value = module.Damage
script.Parent.Configuration.ChaseRange.Value = math.huge
local anim = script.Parent.Monster.Animator:LoadAnimation(script.Parent.RageAnim)
anim:AdjustSpeed(module.RageTime)
anim:Play()
local start = workspace.ModeSounds:FindFirstChild(module.Start, true)
if start then
start:Play()
else
workspace.ModeSounds.BloodStart:Play()
end
colorTween = ts:Create(game.Lighting.Mode, TweenInfo.new(module.RageTime, Enum.EasingStyle.Sine, Enum.EasingDirection.InOut, 0, false, 0), {
TintColor = module.Color
})
script.Parent.Raging.Value = true
colorTween:Play()
colorTween.Completed:Wait()
anim:Stop()
local music = workspace.ModeSounds:FindFirstChild(module.Music, true)
if music then
music:Play()
else
workspace.ModeSounds.BloodMusic:Play()
end
script.Parent.Raging.Value = false
end
end
end)
This is the module template :
local mode = {}
mode.Text = "hello"
mode.RageTime = 33
mode.Music = "Music"
mode.Start = "Start"
mode.Damage = 35 --monsters damage
mode.Speed = 40 --monsters speed
mode.Color = Color3.fromRGB(255,0,0) --color of fog
mode.TextColor = Color3.fromRGB(255,0,0) --color of text
return mode