Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

Camera not cframing after its told by a script , how to fix this issue?

-------------------------------------------------------
local repStorage = game:GetService("ReplicatedStorage")
local RemoteFolder = repStorage.RemoteEvents
local StartGameEvent = RemoteFolder.Startgame
------------------------------------------------------- 
local SoundEffect = workspace.SoundEffects
local TextValue = repStorage.TextValue
local Camera = workspace.CurrentCamera
------------------------------------------------------- 
local function Startgame(plr)
	print("Game Began")
	SoundEffect.HeartBeat:Play()
	SoundEffect.Beep:Play()
	for i = 1, 46
	do
	wait(.05)
	game.Lighting.Blur.Size = game.Lighting.Blur.Size - 1
	end
	wait(1)
	TextValue.Value = "You: What is this place"
	wait(3)
	TextValue.Value = "Where am i?"
	wait(3)
	TextValue.Value = "?: You are at the council"
	wait(3)
	TextValue.Value = "Here your faith shall be decided"
	wait(3)
	TextValue.Value = "You: What do you mean?"
	wait(3)
	TextValue.Value = "?: What i mean"
	wait(3)
	TextValue.Value = "Is either you live"
	wait(3)
	TextValue.Value = "Or"
	wait(3)
	TextValue.Value = "DIE!"
	SoundEffect.ShockEffect:Play()
	plr.PlayerGui.Main.BlackScreen.Visible = true
	wait(1.5)
	TextValue.Value = ""
	plr.Character.HumanoidRootPart.Position = Vector3.new(33, 5.5, 44)
	plr.PlayerGui.Main.BlackScreen.Visible = false
	Camera.CameraType = Enum.CameraType.Scriptable
	Camera.CFrame = workspace.CameraPart_grave.CFrame -- Error line
	print("Test?")
end

StartGameEvent.OnServerEvent:Connect(Startgame)

Camera is Cframed by a other script aswell

local Player = game.Players.LocalPlayer
local Character = Player.Character or Player.CharacterAdded:Wait()
local Camera = workspace.CurrentCamera
local StarterGui = game:GetService('StarterGui')

repeat wait()
Camera.CameraType = Enum.CameraType.Scriptable
until Camera.CameraType == Enum.CameraType.Scriptable
Camera.CFrame = workspace.CameraPart.CFrame
print("CameraUpdated")

StarterGui:SetCoreGuiEnabled(Enum.CoreGuiType.All, false)
StarterGui:SetCore("ResetButtonCallback", false)

And this is that script

1 comment

0

Is there any errors being outputted? And if so, could you post them?

1 answer

✓ Accepted answer

The problem is that you put the code inside a regular script, and that won't work because you have to put the code inside a LocalScript. LocalScript's are used for things like camera, gui, and more.

This discussion is preserved as it was. New answers, comments, and votes are closed.