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

3rd person script why it don't work? [described concisely] [figered out my self]

Asked by
dekkeda 30
5 years ago
Edited 5 years ago

I dont know why this doesnt work. The CameraPart exist is the serverstorage. You can also see this as toggling shiftlock but with a script

wait(5)
local Player = game.Players.LocalPlayer
local Character = Player.Character or Player.CharacterAdded:Wait()
local Camera = workspace.CurrentCamera

Player.CharacterAdded:Wait()

local part = game.ServerStorage.CameraPart:Clone()
part.Parent = game.Workspace
part.Name = Player.UserId
part.Anchored = true
part.Transparency = 1
part.CanCollide = false
part.Orientation = Vector3.new(-13.61, 0, 0)
part.Position = Character.HumanoidRootPart.Position + Vector3.new(2.787, 2.608, 3.825)

repeat wait()
    Camera.CameraType = Enum.CameraType.Scriptable
until Camera.CameraType == Enum.CameraType.Scriptable
Camera.CFrame = game.Workspace[Player.UserId].CFrame
0
First thing. Since this script manipulates the player's camera, it has to be inside of the local script. Since the camera is all hosted by clients, trying to get the camera from normal script will return an error. Second thing. If this code is inside local script, you won`t be able to access the serverstorage because that is only accessable by server, not client. Yuuwa0519 197 — 5y
0
Oops got second thing lol dekkeda 30 — 5y
0
However this does not fix the code dekkeda 30 — 5y

1 answer

Log in to vote
0
Answered by
dekkeda 30
5 years ago

I figured it out through another way

Ad

Answer this question