How do I transfer the information of the character and camera variables being changed to the rest of the script?
The script:
local plr = game.Players.LocalPlayer
local plrCamera = game.Workspace.CurrentCamera
local remoteEvents = game.ReplicatedStorage.RemoteEvents
local cameraEvent = remoteEvents.CameraInitialize
plrCamera.CameraType = Enum.CameraType.Scriptable
local character = nil
local camera = nil
local intial = cameraEvent.OnClientEvent:Connect(function(playerPart, cameraPart)
if not playerPart or not cameraPart then
cameraEvent:FireServer(plr)
else
plrCamera.CFrame = cameraPart.CFrame
character = playerPart
camera = cameraPart
end
end)
print(character)
print(camera)