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

My Camera Script breaks after death?

The script is under StarterPlayerScripts, anytime I die/reset the Camera script seems to not work after.

local plr = game.Players.LocalPlayer local char = plr.CharacterAdded:wait() local hum = char:WaitForChild("Humanoid") local rootpart,head = char:WaitForChild("HumanoidRootPart"),char:WaitForChild("Head") game:GetService("RunService"):BindToRenderStep("CameraOffset",Enum.RenderPriority.Camera.Value-1,function() hum.CameraOffset = (rootpart.CFrame+Vector3.new(0,1.5,0)):pointToObjectSpace(head.CFrame.p) end)

2 comments

0

Can't you just sense if someone dies and make it so when there character re - spawns it does the script again?

0

Sorry, how would I go about doing that? I'm fairly new to LUA and had help with this script

1 answer

Make a screen gui in the startergui and disable the ResetOnSpawn then paste your script in it which is

ocal plr = game.Players.LocalPlayer local char = plr.CharacterAdded:wait() local hum = char:WaitForChild("Humanoid") local rootpart,head = char:WaitForChild("HumanoidRootPart"),char:WaitForChild("Head") game:GetService("RunService"):BindToRenderStep("CameraOffset",Enum.RenderPriority.Camera.Value-1,function() hum.CameraOffset = (rootpart.CFrame+Vector3.new(0,1.5,0)):pointToObjectSpace(head.CFrame.p) end)

Hope this answered your question

2 comments

0

Hmm, I just tried it; it doesn't seem to work. Maybe it could be my coding?

0

As I said, make a screengui in StarterGui make a localscript in it and make the set the option of the screengui ResetOnSpawn to false

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