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

Why is the camera resetting?

Asked by 8 years ago

So I am making an IntroGUI and that has a camera pointing at the map and when they pick their team they die so I'm trying to make it that when they die the camera still points at the map and not focused on the player. (Sorry if this sounds confusing) This script is in ServerStorage and it is a LocalScript.

Here's my script:

local humanoid = game.Players.LocalPlayer.Character.Humanoid
if humanoid.Health <= 100 then
cam = game.Workspace.CurrentCamera

cam.CameraSubject = game.Workspace.FocusHere
cam.CameraType = "Attach"
end
0
Don't put localScripts inside serverStorage. It will error because the character loads slower than the player. the if statement will only check once, you didn't indent your code, and you didn't use a local variable. Although the last two don't really mess up the code.... theCJarmy7 1293 — 8y
0
What should I put the local script in? BennyBoiOriginal 293 — 8y
0
The best would be to put it in "game.StarterPlayer.StarterCharacterScripts" or "game.StarterPlayerScripts". Note that scripts placed in StarterCharacterScripts will be copied over to the player's character model everytime he/she respawns, causing them to start over from the begining. Link150 1355 — 8y
0
Hmm my script is already in StarterPlayerScripts... but it's also in ServerScriptService. BennyBoiOriginal 293 — 8y

Answer this question