Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local ContentProvider = game:GetService("ContentProvider")
- local TweenService = game:GetService("TweenService")
- local Players = game:GetService("Players")
- local RunService = game:GetService("RunService")
- -- Wait module (by Pyseph) below
- local o_clock = os.clock
- local c_yield = coroutine.yield
- local c_running = coroutine.running
- local c_resume = coroutine.resume
- local Yields = {}
- RunService.Stepped:Connect(function()
- local Clock = o_clock()
- for Idx, data in next, Yields do
- local Spent = Clock - data[1]
- if Spent >= data[2] then
- Yields[Idx] = nil
- c_resume(data[3], Spent, Clock)
- end
- end
- end)
- local function wait(Time)
- Time = (type(Time) ~= 'number' or Time < 0) and 0 or Time
- table.insert(Yields, {o_clock(), Time, c_running()})
- return c_yield()
- end
- -- Wait module (by Pyseph) above
- game:GetService("ReplicatedFirst"):RemoveDefaultLoadingScreen()
- local function CharSelect()
- -- empty lol
- print("Rorschach in Danmaku")
- end
- local function TitleTransition() -- This transitions from LoadingScreen to TitleScreen
- local canvas = script.Parent.Title
- canvas.BackgroundTransparency = 0
- canvas.BackgroundColor3 = Color3.new(0.176,0.176,0.176)
- for _, i in pairs(canvas:GetChildren()) do
- i.Visible = false
- end
- canvas.LogoLabel.Visible = true
- canvas.LogoLabel.Position = UDim2.new(1.018, 0, 0.169, 0) -- Once title is adjusted, you should change this
- local fade = TweenService:Create(canvas,TweenInfo.new(2),{BackgroundColor3 = Color3.new(0,0,0)})
- local white = TweenService:Create(script.Parent.OnTop,TweenInfo.new(1),{BackgroundTransparency = 0})
- local restore = TweenService:Create(script.Parent.OnTop,TweenInfo.new(1),{BackgroundTransparency = 1})
- fade.Completed:Connect(function()
- wait(3)
- canvas.LogoLabel:TweenPosition(UDim2.new(0.018, 0, 0.169, 0), "Out", "Linear", 0.5, true, function() -- this too
- script.Parent.OnTop.Visible = true
- white:Play()
- end)
- end)
- white.Completed:Connect(function()
- canvas.BackgroundTransparency = 1
- restore:Play()
- for _, i in pairs(canvas:GetChildren()) do
- i.Visible = true
- end
- for i = 1, 50 do
- canvas.Position = UDim2.new(math.random(-5,5)/(60+i), 0, math.random(-5,5)/(60+i), 0)
- wait(1/40)
- end
- canvas.Position = UDim2.new(0, 0, 0, 0)
- end)
- restore.Completed:Connect(function()
- script.Parent.OnTop.Visible = false
- end)
- fade:Play() -- Mostly done. Update LogoLabel position when adjusting time comes
- end
- local function TitleScreen(bool) -- Creates main title screen
- if bool then
- TitleTransition()
- end
- local canvas = script.Parent.Title
- canvas.Visible = true
- canvas.PlayButton.MouseButton1Up:Connect(function()
- --transition ig
- CharSelect()
- end)
- end
- local function LoadingScreen() -- Loads assets upon first joining
- script.Parent.Title.Visible = false -- Mostly done. Add things to priority assets later.
- local canvas = script.Parent.Loading
- canvas.Visible = true
- -- create loading screen components
- local prioritylabel = Instance.new("TextLabel", canvas)
- prioritylabel.Position = UDim2.new(0, 0, 0, 0)
- prioritylabel.Size = UDim2.new(0.981, 0, 0.96, -20)
- prioritylabel.BackgroundTransparency = 1
- prioritylabel.BorderSizePixel = 0
- prioritylabel.Text = "Menu loading hasn't started yet."
- prioritylabel.TextSize = 10
- prioritylabel.TextXAlignment = "Right"
- prioritylabel.TextYAlignment = "Bottom"
- prioritylabel.TextColor3 = Color3.new(1,1,1)
- local normallabel = Instance.new("TextLabel", canvas)
- normallabel.Position = UDim2.new(0, 0, 0, 0)
- normallabel.Size = UDim2.new(0.981, 0, 0.96, 0)
- normallabel.BackgroundTransparency = 1
- normallabel.BorderSizePixel = 0
- normallabel.Text = "General loading hasn't started yet."
- normallabel.TextSize = 10
- normallabel.TextXAlignment = "Right"
- normallabel.TextYAlignment = "Bottom"
- normallabel.TextColor3 = Color3.new(1,1,1)
- local startbutton = Instance.new("TextButton", canvas)
- startbutton.Position = UDim2.new(0.406, 0, 0.499, 0)
- startbutton.Size = UDim2.new(0, 200, 0, 50)
- startbutton.BackgroundColor3 = Color3.new(0.38, 0.792, 0.125)
- startbutton.BorderSizePixel = 7
- startbutton.Text = "Start"
- startbutton.TextSize = 10
- startbutton.MouseButton1Down:Connect(function()
- canvas.BackgroundTransparency = 1
- TitleScreen(true)
- startbutton:Destroy()
- end)
- local priorityassets = {}
- -- insertion of client assets into loading priority
- local function Scan(location,mytable)
- for _, i in pairs(location:GetChildren()) do
- if i:IsA'ImageLabel' then
- table.insert(mytable, i.Image)
- elseif i:IsA'ImageButton' then
- table.insert(mytable, i.Image)
- elseif i:IsA'Sound' then
- table.insert(mytable, i.SoundId)
- end
- Scan(i,mytable)
- end
- end
- -- index priority assets
- Scan(script.Parent.Loading, priorityassets)
- Scan(script.Parent.Title, priorityassets)
- -- update with more stuff later
- -- load priority assets
- for i = 1,#priorityassets do
- ContentProvider:PreloadAsync({priorityassets[i]})
- prioritylabel.Text = "Menu assets have been loaded:"..math.floor(100*i/#priorityassets).."%..."
- end
- prioritylabel.Text = "Menu assets finished loading!"
- --load normal assets
- while (ContentProvider.RequestQueueSize > 0) do
- normallabel.Text = math.floor(ContentProvider.RequestQueueSize).." assets left..."
- wait(1/60)
- end
- normallabel.Text = "All assets finished loading!"
- local okbutton = Instance.new("TextButton", canvas)
- okbutton.Position = UDim2.new(0.77, 0, 1.12, 0)
- okbutton.Size = UDim2.new(0, 20, 0, 20)
- okbutton.Text = "OK!"
- okbutton.BorderSizePixel = 3
- okbutton.BackgroundColor3 = Color3.new(0.851, 0.506, 0.161)
- okbutton.MouseButton1Down:Connect(function()
- okbutton:TweenPosition(UDim2.new(0.77, 0, 1.42, 0), "In", "Back", 1, true, function() okbutton:Destroy() end)
- normallabel:TweenPosition(UDim2.new(0, 0, 0.5, 0), "In", "Back", 1, true, function() normallabel:Destroy() end)
- end)
- okbutton:TweenPosition(UDim2.new(0.77, 0, 0.92, 0), "Out", "Back", 1, false)
- prioritylabel:TweenPosition(UDim2.new(1, 0, 0, 0), "In", "Quad", 2, true, function() prioritylabel:Destroy() end)
- _G.Loaded = true
- end
- if _G.Loaded == true then
- TitleScreen(false)
- else
- LoadingScreen()
- end
- --start of list start of list start of list start of list start of list
- --ANY USE
- local updatedroot
- local Camera = workspace.CurrentCamera
- --LOADVIEW USE ONLY
- local lastd = 0
- local debounce = true
- local currentroot = workspace.SpectateRoots["Spawn"]
- local crootcf = currentroot.CFrame
- local descamcf
- --end of list end of list end of list end of list end of list
- local function LoadView(newroot) -- Creates circle spinny perspective when spawning
- if debounce then
- debounce = false
- if newroot ~= currentroot then
- currentroot = newroot
- crootcf = currentroot.CFrame
- descamcf = CFrame.lookAt(((crootcf * CFrame.Angles(0, math.rad(lastd), 0) * CFrame.new(0, 25, 25))).Position, currentroot.Position)
- --transition lol
- end
- debounce = true
- end
- while currentroot == updatedroot do
- if lastd > 359.5 then lastd = 0 end
- for d = lastd,360,0.5 do
- lastd = d
- Camera.CameraType = "Scriptable"
- Camera.CFrame = CFrame.lookAt(((crootcf * CFrame.Angles(0, math.rad(d), 0) * CFrame.new(0, 25, 25))).Position, currentroot.Position)
- wait(1/60)
- end
- end
- end
- wait(10) -- REMOVE REMOVE REMOVE REMOVE REMOVE REMOVE REMOVE REMOVE REMOVE REMOVE REMOVE REMOVE REMOVE REMOVE REMOVE REMOVE REMOVE REMOVE
- updatedroot = workspace.SpectateRoots["Spawn"]
- LoadView(updatedroot)
- wait(10)
- print("now")
- updatedroot = workspace.SpectateRoots["Mountain"]
- LoadView(updatedroot)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement