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

How Do I Create A Spectating Script?

Asked by 10 years ago

I am currently working on a game that included spectating. How do I make a spectating script?

1 answer

Log in to vote
0
Answered by
Discern 1007 Moderation Voter
10 years ago

This would need to be in a LocalScript located in the player's StarterGui or Backpack. You find the CurrentCamera in Workspace, and change the CameraSubject to the desired player's Humanoid (To view First Person).

game.Workspace.CurrentCamera.CameraSubject = game.Players.DESIREDPLAYER.Character.Humanoid

That is just an outline/guide. Putting that in an empty script and running the game won't make it work. To change it back, just make the CameraSubject to the original player's Humanoid with the following:

game.Workspace.CurrentCamera.CameraSubject = game.Players.LocalPlayer.Character.Humanoid

More information can be found here.

Hoped I helped.

Ad

Answer this question