Introducing Start Screen Module
By TheBrainy06
About the module
Have you ever had trouble creating a good starting screen for your game? Well, this is the perfect module for you!
How to use it?
In order to use it, you have to take the free model using this (click) link and insert it into your game. Here is how you call the function:
(make sure that this is a LocalScript
!)
local startScreenModule = require(path.to.module)
startScreenModule(player,gameName,camPart)
Arguments to Pass
player - the player instance to which the starting screen should be shown to.
gameName - the name of the game (which will be displayed in the starting screen)
camPart - a part in workspace (the pov of the part will be shown to the player)
Screenshots + Video
Screenshot
Video
Source Code for Curious People
return function(plr,gameName,camPart)
local Lighting = game:GetService("Lighting")
local TweenService = game:GetService("TweenService")
local RunService = game:GetService("RunService")
local StarterGui = game:GetService("StarterGui")
local camera = workspace.Camera
local hoverTi = TweenInfo.new(0.2,Enum.EasingStyle.Linear,Enum.EasingDirection.InOut,0,false)
local cameraTi = TweenInfo.new(0.5,Enum.EasingStyle.Linear,Enum.EasingDirection.InOut,0,false)
local vanishTi = TweenInfo.new(2,Enum.EasingStyle.Linear,Enum.EasingDirection.InOut,0,false)
local mouse = plr:GetMouse()
local isLoaded = false
local lastMousePos = mouse.Hit.p
StarterGui:SetCoreGuiEnabled("All",false)
local Blur = Instance.new("BlurEffect")
Blur.Size = 15
Blur.Parent = Lighting
local clonedUi = script:WaitForChild("StartScreen"):Clone()
clonedUi.Title.Text = gameName
camera.CameraType = Enum.CameraType.Scriptable
camera.CFrame = camPart.CFrame
clonedUi.Play.MouseEnter:Connect(function()
TweenService:Create(clonedUi.Play,hoverTi,{BackgroundColor3 = Color3.fromRGB(69,69,69),TextColor3 = Color3.fromRGB(255,255,255)}):Play()
end)
clonedUi.Play.MouseLeave:Connect(function()
TweenService:Create(clonedUi.Play,hoverTi,{BackgroundColor3 = Color3.fromRGB(255,255,255),TextColor3 = Color3.fromRGB(0,0,0)}):Play()
end)
clonedUi.Play.MouseButton1Click:Connect(function()
TweenService:Create(clonedUi.Play,vanishTi,{BackgroundTransparency = 1,TextTransparency = 1}):Play()
TweenService:Create(clonedUi.Title,vanishTi,{BackgroundTransparency = 1,TextTransparency = 1}):Play()
TweenService:Create(Blur,vanishTi,{Size = 0}):Play()
clonedUi.Split:TweenSize(UDim2.new(1,0,1,0),Enum.EasingDirection.Out,Enum.EasingStyle.Linear,1,false)
wait(1)
TweenService:Create(clonedUi.Split,vanishTi,{BackgroundTransparency = 1}):Play()
camera.CameraType = Enum.CameraType.Custom
StarterGui:SetCoreGuiEnabled("All",true)
isLoaded = true
clonedUi:Destroy()
end)
clonedUi.Parent = plr.PlayerGui
while wait() do
if isLoaded then
break
end
if mouse.Hit.p.X - lastMousePos.X > 0 then
TweenService:Create(camera,cameraTi,{CFrame = camPart.CFrame + Vector3.new(5,0,0)}):Play()
elseif mouse.Hit.p.X - lastMousePos.X < 0 then
TweenService:Create(camera,cameraTi,{CFrame = camPart.CFrame - Vector3.new(5,0,0)}):Play()
end
lastMousePos = mouse.Hit.p
end
end
Any Questions or Need Help?
Feel free to ask it by replying to this post or, by shooting me a DM here at devforum!
Thanks for Reading!