--stunSound.Volume = 1/(script.Parent.Dist.Value*script.Parent.Dist.Value)

stunSound:Play()
 
local tweenInfo = TweenInfo.new(
	script.Parent.Time.Value, -- Time
	Enum.EasingStyle.Linear, -- EasingStyle
	Enum.EasingDirection.InOut, -- EasingDirection
	0, -- RepeatCount (when less than zero the tween will loop indefinitely)
	false, -- Reverses (tween will reverse once reaching it's goal)
	0 -- DelayTime
)

local tween0 = TweenService:Create(stunSound, TweenInfo.new(script.Parent.Time.Value), {Volume = stunSound.Volume*2})
tween0:Play()
 
local tween = TweenService:Create(guiMain, tweenInfo, {Brightness = 0})
tween:Play()

spawn(function()
	wait(script.Parent.Time.Value)
	
	local tween = TweenService:Create(stunSound, TweenInfo.new(0.5), {Volume = 0})
	tween:Play()
end)

wait(script.Parent.Time.Value + .5)
