I wanted to make a little main menu, the camera would go to another parts cframe, right when the players added, I tried it in a startcharacterscripts, the playeradded wouldnt fire the module,
i did it in a serverscriptservice, it wouldnt change the cameras position, CFrame wouldnt work at all, it wont change the players camera position
-- StarterCharacterScripts/ServerScriptService script
local plrs = game:GetService("Players")
plrs.PlayerAdded:Connect(function(plr)
print("Firing modules")
local MMCH = require(game.StarterPlayer.StarterCharacterScripts.MainMenuStuff.MainMenuCameraHandler)
MMCH.Begin()
end)
--Module Script they are trying to fire for main menu
local mmc = {}
function mmc.Begin()
print("starting")
-- setup --
local ts = game:GetService("TweenService")
local plr = game.Players.LocalPlayer
local pcam = workspace.CurrentCamera
local mmcam = workspace:WaitForChild("SpawnPlace"):WaitForChild("MenuCamera")
repeat
task.wait()
pcam.CameraType = Enum.CameraType.Scriptable
until
pcam.CameraType == Enum.CameraType.Scriptable
print("trying")
-- Intro for mainmenu --
pcam.CFrame = mmcam.CFrame
print("changed cframe")
--Tweening
local info = TweenInfo.new(4, Enum.EasingStyle.Elastic,Enum.EasingDirection.InOut,0,false,0)
local goalfr = {
CFrame = mmcam.CFrame * CFrame.Angles(0,math.rad(360),0)
}
local IntroTween = ts:Create(mmcam,info,goalfr)
IntroTween:Play()
--Done tweening
end
function mmc.End()
end
return mmc