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

01wait(5)
02local Player = game.Players.LocalPlayer
03local Character = Player.Character or Player.CharacterAdded:Wait()
04local Camera = workspace.CurrentCamera
05 
06Player.CharacterAdded:Wait()
07 
08local part = game.ServerStorage.CameraPart:Clone()
09part.Parent = game.Workspace
10part.Name = Player.UserId
11part.Anchored = true
12part.Transparency = 1
13part.CanCollide = false
14part.Orientation = Vector3.new(-13.61, 0, 0)
15part.Position = Character.HumanoidRootPart.Position + Vector3.new(2.787, 2.608, 3.825)
16 
17repeat wait()
18    Camera.CameraType = Enum.CameraType.Scriptable
19until Camera.CameraType == Enum.CameraType.Scriptable
20Camera.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