i tried making this work but for some reason its not
local RunService = game:GetService("RunService")
local ReplicatedFirst = game:GetService("ReplicatedFirst")
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local ContextActionService = game:GetService("ContextActionService")
local UserInputService = game:GetService("UserInputService")
local TweenService = game:GetService("TweenService")
local starterGui = game:GetService("StarterGui")
local Players = game:GetService("Players")
local player = Players.LocalPlayer
local Camera = workspace.CurrentCamera
local playerScripts = player:WaitForChild("PlayerScripts")
local controls = require(game:GetService("Players").LocalPlayer.PlayerScripts.PlayerModule):GetControls()
spawn(function()
local success = false
repeat
success = pcall(function()
starterGui:SetCoreGuiEnabled(Enum.CoreGuiType.All, false)
starterGui:SetCore("TopbarEnabled", false)
starterGui:SetCore("ResetButtonCallback", false)
end)
task.wait(0.1)
until success
end)
-- Unbind the default zoom action
ContextActionService:UnbindAction("BaseCameraKeyboardZoom")
local function disableMovement()
controls:Disable()
end
local function enableMovement()
controls:Enable()
end
local function disablePlayerCamera()
if Camera then
Camera.CameraType = Enum.CameraType.Scriptable
else
warn("Camera not found!")
return
end
end
local function enablePlayerCamera()
if Camera then
Camera.CameraType = Enum.CameraType.Fixed
else
warn("Camera not found!")
return
end
end
if Camera then
Camera.CameraType = Enum.CameraType.Scriptable
else
warn("Camera not found!")
return
end
disableMovement()
local function tweenToCamera(cameraPart, duration)
if cameraPart and cameraPart:IsA("BasePart") then
local tweenInfo = TweenInfo.new(duration, Enum.EasingStyle.Linear)
local goal = { CFrame = cameraPart.CFrame }
local tween = TweenService:Create(Camera, tweenInfo, goal)
tween:Play()
tween.Completed:Wait()
end
end