#How do i fix this script to make audio fade out (tweens)
68 messages · Page 1 of 1 (latest)
When you've defined it as "music"
There is nothing inside of goal
Ah nvm I see it is defined now
But what's the point of making a new sound with instance.new
oh
** You are now Level 4! **
i wasnt sure what instance.new does
so i'm not supposed to make a new sound instance
when i alrdy designated sound?
Nope. There is no need to make a new sound using instance.new when you already have a designated sound
Are there any errors from your code?
uhm
i'm not exactly sure
the sound doesnt fade out as intended
so probably
though i have a whole different script for playing the sound
local sound = script.Parent.Parent.MainMenuMusic
script.Parent.MouseButton1Click:Connect(function(clicked)
sound:stop()
end)
i have this to stop the sound
Are you trying to make it fade in our out? @rustic latch
out
Okay
cause i put the script on the play button
so when i press it it fades out
is the goal
local sound = script.Parent.Parent.MainMenuMusic
local TweenService = game:GetService("TweenService")
sound.Volume = 1
sound:Play()
local goal = {Volume = 0}
local volume = script.Parent.Parent.MainMenuMusic.Volume
local tweenInfo = TweenInfo.new(2)
local tween = TweenService:Create(sound,tweenInfo, goal)
tween:Play()
Try this
And if it doesn't work tell me if there are any errors
@rustic latch
and if that doesnt work
wait
before i do it
do i remove the other local script that plays the music
or do i keep it
oh wait
it works now
i removed the other script
wait i think i need to make the tween work when i click play
instead of automatically fading music out when i load in
But is it tied to a button I mean
well yeah
mouse1
click
YESSS
i made it work
local sound = script.Parent.Parent.MainMenuMusic
local TweenService = game:GetService("TweenService")
sound.Volume = 1
sound:Play()
local goal = {Volume = 0}
local volume = script.Parent.Parent.MainMenuMusic.Volume
local tweenInfo = TweenInfo.new(2)
local tween = TweenService:Create(sound,tweenInfo, goal)
script.Parent.MouseButton1Click:Connect(function(clicked)
tween:Play()
end)

i also have a question
i wanna make some sort of loading screen because whenever i load in the play/character/settings buttons are barely loaded and then half a second later the font and etc appears and it ruins the look of everything
like i want everything to load in before it goes play/etc
without ruining my main menu ui
In this video i'll show you quickly how to make a loading.
That is the script:
local ReplicatedStorage = game:GetService('ReplicatedStorage') -- useless
local ReplicatedFirst = game:GetService('ReplicatedFirst') -- get replicatedfirst
local ContentProvider = game:GetService("ContentProvider") -- get contentprovider in this video it will hel...