local Players = game:GetService("Players")
local localPlayer = Players.LocalPlayer
local screenGui = Instance.new("ScreenGui")
screenGui.Name = "ThirdPersonGui"
local success = pcall(function()
screenGui.Parent = game:GetService("CoreGui")
end)
if not success then
screenGui.Parent = localPlayer:WaitForChild("PlayerGui")
end
local button = Instance.new("TextButton")
button.Name = "ToggleButton"
button.Parent = screenGui
button.Size = UDim2.new(0, 160, 0, 45)
button.Position = UDim2.new(0.05, 0, 0.2, 0)
button.Text = "3rd Person: OFF"
button.BackgroundColor3 = Color3.fromRGB(180, 40, 40)
button.TextColor3 = Color3.fromRGB(255, 255, 255)
button.Font = Enum.Font.SourceSansBold
button.TextSize = 16
button.Active = true
button.Draggable = true
local uiCorner = Instance.new("UICorner")
uiCorner.CornerRadius = UDim.new(0, 8)
uiCorner.Parent = button
local isEnabled = false
button.MouseButton1Click:Connect(function()
isEnabled = not isEnabled
if isEnabled then
localPlayer.CameraMode = Enum.CameraMode.Classic
localPlayer.CameraMaxZoomDistance = 128
localPlayer.CameraMinZoomDistance = 12
button.Text = "3rd Person: ON"
button.BackgroundColor3 = Color3.fromRGB(40, 180, 40)
else
localPlayer.CameraMode = Enum.CameraMode.LockFirstPerson
localPlayer.CameraMinZoomDistance = 0.5
localPlayer.CameraMaxZoomDistance = 0.5
button.Text = "3rd Person: OFF"
button.BackgroundColor3 = Color3.fromRGB(180, 40, 40)
end
end)