I have a camera script which I created here.
Once an event is fired from the server, it checks to see whether the server has requested for the manipulation to be enabled, or disabled.
When the server requests for the manipulation to be disabled, the manipulation doesn't reset, and as such the player doesn't gain control of the camera.
Is there anything in the script that may be causing this?
01 | ReplicatedStorage = game:GetService( "ReplicatedStorage" ) |
02 | CameraEvent = ReplicatedStorage:WaitForChild( "CameraEvent" ) |
03 | Camera = workspace.CurrentCamera |
04 | Players = game:GetService( "Players" ) |
05 | Player = Players.LocalPlayer |
06 |
07 | function Event(status) |
08 | if status = = "Stop" then |
09 | Camera.CameraSubject = Player.Character.Humanoid |
10 | Camera.CameraType = "Custom" |
11 | end |
12 | if status = = "Use" then |
13 | Camera.CameraSubject = workspace.JudgeBrick |
14 | Camera.CameraType = "Scriptable" |
15 | game:GetService( 'RunService' ).Stepped:Connect( function () -- On |
if you want to reset you can also just disable the camerascript, then goto line 09 and 10 Camera.CameraSubject = Player.Character.Humanoid Camera.CameraType = "Custom"
then you can enable it back when clicked, this is my camera script (When I click a gui button I disable this):
01 | local target = workspace.GameParts.Misc.CameraFocus |
02 | local camera = workspace.CurrentCamera |
03 | camera.CameraType = Enum.CameraType.Scriptable |
04 | camera.CameraSubject = target |
05 | local angle = 180 |
06 | local i = 0 |
07 |
08 | while wait() do |
09 | camera.CoordinateFrame = CFrame.new(target.Position) |
10 | * CFrame.Angles( 0 , angle, 0 ) |
11 | * CFrame.new( 0 , 0 , 0 ) |
12 | angle = angle + math.rad( 1 ) |
13 | i = i + 1 |
14 | if i > 3155692631556926 then break end |
15 |
16 | end |
remember disabling a script is the property of a script, here is my logic.
Script runs or stops, script is disabled/enable by another script, the camera properties are changed by that script. If this didn't help then I would suggest adding more information into how your disabling/resetting.