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

How would I make this Streaming Enabled Compatible?

This is suppose to be a Intro for my game, but for some reason when ever I try to make it go to the camera, it never seems to do it. I do know that Streaming Enabled affects local scripts. This is Filtering Enabled and is a Local Script in my GUI that is in StarterGui.

local Cam = game.Workspace.CurrentCamera
Cam.CameraSubject = game.Workspace:WaitForChild("introhousejjgkdhwoe"):WaitForChild("IntroBrick")
Cam.CameraType = "Custom"
game.Players.LocalPlayer.CameraMaxZoomDistance = 2
game.Players.LocalPlayer.CameraMinZoomDistance = 2

game.Players.LocalPlayer.PlayerGui:SetTopbarTransparency(1)
game:GetService("StarterGui"):SetCoreGuiEnabled(Enum.CoreGuiType.PlayerList, false)
game:GetService("StarterGui"):SetCoreGuiEnabled(Enum.CoreGuiType.Backpack, false)

game.Players.LocalPlayer.PlayerGui.Main.Enabled = false

function BlackTextDisapear()
	local text = script.Parent.Black.Desc
	repeat
		wait(0.001) text.TextTransparency =  text.TextTransparency + 0.02 until text.TextTransparency >= 1
end

function BlackTextAppear()
	local text = script.Parent.Black.Desc
	repeat 
		wait(0.001) text.TextTransparency =  text.TextTransparency - 0.02 until text.TextTransparency <= 0
end

function Assetloader()
	script.Parent.Black.Desc.TextTransparency = 0
	script.Parent.Black.Desc.Text = "Just wait for "..game.ContentProvider.RequestQueueSize.." Assets"
end
--Music--
function Music1()
	local Music = Instance.new("Sound")
	Music.Name = "IntroSong"
	Music.Parent = script.Parent
	Music.SoundId = "rbxassetid://356599100" --Just another day in Compton--
	Music.Volume = 0.4
	Music:Play()
	print("Playing Just another day in Compton By Dr Dre")
end

function Music2()
	local Music = Instance.new("Sound")
	Music.Name = "IntroSong"
	Music.Parent = script.Parent
	Music.SoundId = "rbxassetid://1245929829" --Beam City--
	Music.Volume = 0.8
	Music:Play()
	print("Playing Beam City by MurderousBlixxy")
end

function Music3()
	local Music = Instance.new("Sound")
	Music.Name = "IntroSong"
	Music.Parent = script.Parent
	Music.SoundId = "rbxassetid://512296027" --Im a soldier--
	Music.Volume = 0.6
	Music:Play()
	print("Playing Im a soldier by Tupac")
end


function MusicPlay()
	if script.Parent:FindFirstChild("IntroSong") then return end
		local Number = math.random(1,3)
		print(Number)
		if Number == 1 then
			Music1()
		elseif Number == 2 then
			Music2()
		elseif Number == 3 then
			Music3()
	end
end

local AlreadyRan = false
while true do
	local reqestsize = game.ContentProvider.RequestQueueSize
	if reqestsize <= 0 then
		if AlreadyRan == true then
			wait(1)
			if script.Parent.IntroSong.Playing == false then
				wait(1)
				script.Parent.IntroSong:Destroy()
				wait(1)
					MusicPlay()
					wait(5)
			end
		else
		local text = script.Parent.Black.Desc
		text.TextTransparency = 0
		text.Text = "Assets Loaded!"
		wait(1)
		script.Parent.Black.Visible = true
		MusicPlay()		
		BlackTextDisapear()
		text.Text = "Sergiomontani10 Presents"
		BlackTextAppear()					 --Say next thing--
		BlackTextDisapear()
		text.Text = "Los Angeles"
		BlackTextAppear()
		BlackTextDisapear()
		script.Parent.Play.Visible = true
		script.Parent.Title.Visible = true
		script.Parent.Black.BackgroundTransparency = 0.1
		wait(0.05)
		script.Parent.Black.BackgroundTransparency = 0.2
		wait(0.05)
		script.Parent.Black.BackgroundTransparency = 0.3
		wait(0.05)
		script.Parent.Black.BackgroundTransparency = 0.4
		wait(0.05)
		script.Parent.Black.BackgroundTransparency = 0.5
		wait(0.05)
		script.Parent.Black.BackgroundTransparency = 0.6
		wait(0.05)
		script.Parent.Black.BackgroundTransparency = 0.7
		wait(0.05)
		script.Parent.Black.BackgroundTransparency = 0.8
		wait(0.05)
		script.Parent.Black.BackgroundTransparency = 0.9
		wait(0.05)		
		script.Parent.Black:Destroy()
		AlreadyRan = true
		end
	else
		Assetloader()
		wait(0.1)
	end
end

1 answer

✓ Accepted answer

###Check out lines 103-120. You could make your life simpler with a for loop.

for i = 0, 1, 0.1 do
    script.Parent.Black.BackgroundTransparency = i
    wait(.05)
end

###I know it isn't going to answer your question but it had to get out there ._.

1 comment

0

No problem I already found out the my camera needed a :WaitForChild()

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