Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

My intro GUI music is delayed?

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()

2 comments

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

0

How do I make custom load screen?

1 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()

1 comment

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.

This discussion is preserved as it was. New answers, comments, and votes are closed.