Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
1

My intro GUI music is delayed?

Asked by
Rdite 30
9 years ago

I want the music to start instantly as the GUI appears can someone help me I can't figure it out.

local text = "Welcome To Prison Escape By iethand"

local player = script.Parent.Parent
local gui = script.Parent
local sound = Instance.new("Sound",gui)
sound.SoundId = "http://www.roblox.com/asset/?id=207012155"
sound.Pitch = 1
sound.Volume = 0.8
sound:play()
local frame = gui.Frame
local text1 = frame.TextLabel
local pic = frame.ImageLabel
wait(1)
for i = 1,string.len(text),1 do
text1.Text = string.sub(text,1,i)
wait(0.2)
end
coroutine.resume(coroutine.create(function()
for i = 0,25,0.01 do
text1.Position = UDim2.new(0,0,i,0)
pic.Transparency = pic.Transparency - 0.04
wait()
end
end))
for i = 1,50,1 do
text1.TextTransparency = text1.TextTransparency + 0.07
pic.ImageTransparency = pic.ImageTransparency + 0.07
pic.Position = UDim2.new(0.38,0,i,0)
wait(0.07)
end
for i = 1,50,1 do
frame.BackgroundTransparency = frame.BackgroundTransparency + 0.02
pic.Transparency = pic.Transparency + 0.02
sound.Volume = sound.Volume - 0.02
wait(0.07)
end
sound:stop()
gui:remove()
0
This is roblox's fault and you should make a custom load screen or load the sound at the time then play the script okay. :D RM0d 305 — 9y
0
How do I make custom load screen? Rdite 30 — 9y

1 answer

Log in to vote
-1
Answered by 9 years ago

Please provide explanation with your answers. Simply posting code does not spread knowledge of integral scripting processes which helps people understand the logic and reasoning behind your answer.
local sound = Instance.new("Sound",script.Parent)
sound.SoundId = "http://www.roblox.com/asset/?id=207012155"
sound.Pitch = 1
sound.Volume = 0.8
sound:play()

local text = "Welcome To Prison Escape By iethand"

local player = script.Parent.Parent
local gui = script.Parent
local frame = gui.Frame
local text1 = frame.TextLabel
local pic = frame.ImageLabel
wait(1)
for i = 1,string.len(text),1 do
text1.Text = string.sub(text,1,i)
wait(0.2)
end
coroutine.resume(coroutine.create(function()
for i = 0,25,0.01 do
text1.Position = UDim2.new(0,0,i,0)
pic.Transparency = pic.Transparency - 0.04
wait()
end
end))
for i = 1,50,1 do
text1.TextTransparency = text1.TextTransparency + 0.07
pic.ImageTransparency = pic.ImageTransparency + 0.07
pic.Position = UDim2.new(0.38,0,i,0)
wait(0.07)
end
for i = 1,50,1 do
frame.BackgroundTransparency = frame.BackgroundTransparency + 0.02
pic.Transparency = pic.Transparency + 0.02
sound.Volume = sound.Volume - 0.02
wait(0.07)
end
sound:stop()
gui:remove()

0
Please provide explanation with your answers. Simply posting code does not spread knowledge of integral scripting processes which helps people understand the logic and reasoning behind your answer. AmericanStripes 610 — 9y
Ad

Answer this question