Sure here’s all my main menu related (local) scripts.
-- StarterGui
pcall(function()
local player = game.Players.LocalPlayer
local char = player.Character or player.CharacterAdded:Wait()
local cam = workspace.CurrentCamera
local com = workspace.cammod.com
repeat task.wait()
cam.CameraType = Enum.CameraType.Scriptable
until
cam.CameraType == Enum.CameraType.Scriptable
while script.Parent.Parent do
task.wait();
cam.CFrame = com.CFrame
end
end)
-- Under the Play button in my GUI
script.Parent.MouseButton1Click:Connect(function()
local player = game.Players.LocalPlayer
local character = player.Character or player.CharacterAdded:Wait()
local humanoidRootPart = character:WaitForChild("HumanoidRootPart")
humanoidRootPart.Anchored = false
if not character or not character:FindFirstChild("Humanoid") then
print("Character or Humanoid not found")
return
end
local currentCamera = game.Workspace.CurrentCamera
if not currentCamera then
print("CurrentCamera not found")
return
end
-- camera follows the humanoid (should work?)
currentCamera.CameraType = Enum.CameraType.Custom
currentCamera.CameraSubject = character:FindFirstChildOfClass("Humanoid")
local head = character:FindFirstChild("Head")
if head then
local cameraOffset = Vector3.new(0, 5, -10)
currentCamera.CFrame = CFrame.new(head.Position + cameraOffset, head.Position)
else
print("Head not found in the character")
end
local humanoidRootPart = character:FindFirstChild("HumanoidRootPart")
if humanoidRootPart then
print(player.Name .. " (" .. tostring(humanoidRootPart.CFrame) .. ")")
else
print("HumanoidRootPart not found for " .. player.Name)
end
end)
-- Local script which has the GUI's as children (ReplicatedFirst)
-- Remove default loading screen
game.ReplicatedFirst:RemoveDefaultLoadingScreen()
local Players = game:GetService("Players")
local player = Players.LocalPlayer
local character = player.Character or player.CharacterAdded:Wait()
local Load = script:FindFirstChild("Load")
local Frame = Load:FindFirstChild("Frame")
Load.Parent = player.PlayerGui
local function Debris(item, lifetime)
game:GetService("Debris"):AddItem(item, lifetime)
end
-- await for the game to load
repeat wait() until game:IsLoaded()
local TweenService = game:GetService("TweenService")
local TransparencyInfo = TweenInfo.new(
1,
Enum.EasingStyle.Quint,
Enum.EasingDirection.In,
0,
false,
0
)
local TransparencyTween = TweenService:Create(Frame, TransparencyInfo, {Transparency = 1})
task.wait(2)
TransparencyTween:Play()
Debris(Load, 1) -- adds to queue
task.wait(1)
local WelcomeGui = script.Welcome
WelcomeGui.Parent = player.PlayerGui
local PlayButton = WelcomeGui:FindFirstChild("Play")
local SettingsButton = WelcomeGui:FindFirstChild("Settings")
local FirstThing = WelcomeGui:FindFirstChild("First")
local SecondThing = WelcomeGui:FindFirstChild("Second")
PlayButton:TweenPosition(UDim2.new(0.032, 0, 0.876, 0), Enum.EasingDirection.InOut, Enum.EasingStyle.Quint, 1, false)
FirstThing:TweenPosition(UDim2.new(0.02, 0, 0.88, 0), Enum.EasingDirection.InOut, Enum.EasingStyle.Quint, 1, false)
task.wait(0.25)
SettingsButton:TweenPosition(UDim2.new(0.032, 0, 0.915, 0), Enum.EasingDirection.InOut, Enum.EasingStyle.Quint, 1, false)
SecondThing:TweenPosition(UDim2.new(0.02, 0, 0.917, 0), Enum.EasingDirection.InOut, Enum.EasingStyle.Quint, 1, false)
task.wait(1)
PlayButton.MouseEnter:Connect(function()
FirstThing.Visible = true
end)
SettingsButton.MouseEnter:Connect(function()
SecondThing.Visible = true
end)
PlayButton.MouseLeave:Connect(function()
FirstThing.Visible = false
end)
SettingsButton.MouseLeave:Connect(function()
SecondThing.Visible = false
end)
Photo’s for context:

