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

How do I change the camera for a character?

Asked by 4 years ago

Ive got a script inside of a model, which is called camera. Inside said localscript, are these lines of code:

wait(1)
local cam = game.Workspace.Camera
cam.CameraSubject = game.Players.LocalPlayer.Character.Humanoid

the script is disabled, but is enabled via another script which functions from remote events.

local Terrorist = game.ServerStorage.Tyrannosaurus:Clone()
game.ReplicatedStorage.morphevent.OnServerEvent:Connect(function(player)
    Terrorist.Parent = game.Workspace
    player.Character = Terrorist
    player.Character.Camera.Disabled = false
end)

(excuse the variable, my friend developed most the script)

but for some strange reason, the camera script doesn't transfer, and save to ~~~~~~~~~~~~~~~~~ game.Workspace.Camera ~~~~~~~~~~~~~~~~~ , which I find strange. If you have any fixes, please let me know.

Thanks a lot, irish.

1 answer

Log in to vote
0
Answered by 4 years ago

Put the local script in StarterPlayerScripts or in PlayerGUI

Ad

Answer this question