Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

My Camera Script breaks after death?

Asked by
DMRPG 2
4 years ago

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)

0
Can't you just sense if someone dies and make it so when there character re - spawns it does the script again? NarwhalAndMe 141 — 4y
0
Sorry, how would I go about doing that? I'm fairly new to LUA and had help with this script DMRPG 2 — 4y

1 answer

Log in to vote
0
Answered by
EDLLT 146
4 years ago

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

0
Hmm, I just tried it; it doesn't seem to work. Maybe it could be my coding? DMRPG 2 — 4y
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 EDLLT 146 — 4y
Ad

Answer this question