Here is the code i will tell you what i want below sorry if it’s hard to read this is how i always code i will likely understand your guys responses because I’m Skill coder
local PlrCam = workspace.CurrentCamera
PlrCam.CameraType = Enum.CameraType.Scriptable
all that happens when i try to disconnect the Loop is a huge lag spike that crashes studios this script is located in starterplayerscripts and its for a horror game
that I’ve been asked to code i suppose ending the loop will reset the players camera back to default “correct me if I’m wrong” this is my goal for the code
(i do not understand rendering)
(edit: i just researched what it is, i found out its just a loop, got it)
also can you explain your main goal with some clarity?
but a recommendation is to do
game.Players.PlayerAdded:Connect(function(plr)
--do whatever when the player joins
plr.CharacterAdded:Connect(function(char)
char.Humanoid.Died:Connect(function()
--do what ever :scream:, probs Lock:Disconnect() here ig
end)
end)
end)
local RS = game:GetService("RunService")
-- Declare a name for your function, acts like an identifier.
local function_name = "F1"
-- Function here
local function f1()
-- Your function goes here
end
-- Instead of RS.RenderStepped:Connect(func), use this
RS:BindToRenderStep(function_name, Enum.RenderPriority.First.Value, f1) -- edit args 1 & 2 to your liking
-- Later, unbind this function using the name we set
RS:UnbindFromRenderStep(function_name)