Advertisement
Guest User

Untitled

a guest
Apr 23rd, 2017
51
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.50 KB | None | 0 0
  1. repeat wait () until game.Workspace.CurrentCamera ~= nil
  2.  
  3. local c = game.Workspace.CurrentCamera
  4. local data = LoadLibrary("RbxUtility").DecodeJSON(script.CutsceneData.Value)
  5. local rs = game:GetService("RunService").RenderStepped
  6. wait(9)
  7. function tweenCam(c1,f1,time,fov,roll)
  8. local c0,f0,fv0,r0,frames = c.CoordinateFrame,c.Focus,c.FieldOfView,c:GetRoll(),time/0.015
  9. for i = 1,frames do
  10. c.CameraType = "Scriptable"
  11. c.CoordinateFrame = CFrame.new(c0.p:lerp(c1.p,i/frames),f0.p:lerp(f1.p,i/frames))
  12. c.FieldOfView = (fv0+(fov-fv0)*(i*(1/frames)))
  13. c:SetRoll(r0+(roll-r0)*(i*(1/frames)))
  14. rs:wait()
  15. end
  16. end
  17.  
  18. print("Running")
  19. c.CameraSubject = nil
  20. c.CameraType = "Scriptable"
  21. c.CoordinateFrame = CFrame.new(unpack(data[1].c1))
  22. c.Focus = CFrame.new(unpack(data[1].f1))
  23. c.FieldOfView = data[1].FOV
  24. c:SetRoll(data[1].Roll)
  25. if script:findFirstChild("SkipCutsceneGuiValue") then
  26. local gui = script.SkipCutsceneGui:clone()
  27. gui.Parent = game.Players.LocalPlayer.PlayerGui
  28. gui.Cutscene.Value = script
  29. gui.Main.Debug.Disabled = false
  30. script.SkipCutsceneGuiValue.Value = gui
  31. end
  32. for i = 2,#data do
  33. tweenCam(CFrame.new(unpack(data[i].c1)),CFrame.new(unpack(data[i].f1)),data[i].step,data[i].FOV,data[i].Roll)
  34. end
  35. c.CameraSubject = game.Players.LocalPlayer.Character.Humanoid
  36. c.CameraType = "Custom"
  37. c.FieldOfView = 70
  38. if script:findFirstChild("SkipCutsceneGuiValue") then
  39. if script.SkipCutsceneGuiValue.Value ~= nil then
  40. script.SkipCutsceneGuiValue.Value:Destroy()
  41. end
  42. end
  43. script:Destroy()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement