I want to make it so when the game loads, the camera is automatically set to a point and then later on removed, I used a local script in StarterPlayerScripts , I could only get the camera to be fixed on a certain point ; but after some changes in my code I can’t accomplish that either.
Here’s the code I figured :
local target = workspace.target
local player = game:GetService("Players").LocalPlayer
local new_needed = workspace.CallButtons.NewCamNeeded
local camera = workspace.CurrentCamera
local camsettings = require(game.ServerScriptService.camsettings)
-- local old = workspace.CallButtons.oldcam
-- old.Value = camera.CFrame
camera.CameraType = Enum.CameraType.Scriptable
camera.CameraSubject = target
camera.CFrame = target.CFrame
camera.FieldOfView = 46
camera:WorldToViewportPoint(target.CFrame)
wait(8)
local point = camera:WorldToViewportPoint()---
do
camera:Destroy()
camsettings.createcam()
end
--[[ or should I fix this : camera.CameraType = Enum.CameraType.Custom
camera.FieldOfView = 70
camera.Subject = player.Humanoid
point=nil
camera.CameraSubject = player:FindFirstChild("Humanoid")
camera.CameraType = Enum.CameraType.Custom
camera.FieldOfView = 70
camera:WorldToViewportPoint(x)--I want to try to remove the viewportpoint
camera.
camera.CameraType = Enum.CameraType.Fixed
camera.Parent=nil
camera:Destroy()
local x = second:Clone()
x.Parent = workspace--??]]
and here is the script in ServerScriptService, that was required by the previous
one :
local camsettings = {}
function camsettings.createcam()
local new_needed=workspace.CallButtons.NewCamNeeded
if new_needed.Value==false then return
wait(4)
script.Disabled==true
else
local newcam = Instance.new("Camera")
newcam.Parent = workspace
new_needed.Value=false
end
return camsettings
IF a module script can’t be required by a local one , then how do you set this to happen with a regular one?
As usual, any help at all will be appreciated,