I am making a cryo-freeze chamber which you can view in action here.
When you are frozen, CamFreeze
is parented to your Character and run:
local cam = workspace.CurrentCamera cam.CameraType = Enum.CameraType.Scriptable local val = script:WaitForChild("Value") cam.CoordinateFrame = CFrame.new( val.Value, script.Parent.Head.Position ) repeat wait() until script.Parent.Head.Anchored cam.CoordinateFrame = CFrame.new( val.Value, script.Parent.Head.Position ) script:Destroy()
And, when thawed, CamThaw
:
local cam = workspace.CurrentCamera cam.CameraType = Enum.CameraType.Custom cam.CameraSubject = script.Parent.Humanoid script:Destroy()
My problem is that CamThaw
isn't fixing the Player's camera more than once each life. CamFreeze
appears to work every time, but CamThaw
only works the first time in online and Test Servers. (Test Server players are also unable to actually click the SurfaceGui button, but that's probably a ROBLOX bug as it works in Online Servers.)
What can I do to get this to work? I'm much prefer to have the camera manipulation, because otherwise the only way out of the chamber is to have someone else release you or to reset your character.
I reduced the two scripts to this:
-- Freeze local cam = workspace.CurrentCamera cam.CameraType = Enum.CameraType.Scriptable wait(); cam.CoordinateFrame = CFrame.new(10, 10, 10); script:Destroy()
-- Thaw local cam = workspace.CurrentCamera cam.CameraType = Enum.CameraType.Custom cam.CameraSubject = script.Parent.Humanoid wait(); script:Destroy()
and it seemed to work as expected.
Perhaps the problem is the thing that is adding the localscripts, rather than the localscripts themselves?
Locked by adark
This question has been locked to preserve its current state and prevent spam and unwanted comments and answers.
Why was this question closed?