chromeJ

Shop- Camera Focus

Mar 1st, 2021
26
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. wait(2)
  2. local finish = workspace.Focus1.CFrame
  3. camera = workspace.CurrentCamera
  4. local timed = script.Pos.Value
  5. local player = game.Players.LocalPlayer
  6. local char = nil
  7. finished = nil
  8. local Back = script.Parent.ScreenGui.Backward
  9. local For = script.Parent.ScreenGui.Forward
  10. local itemN = script.Parent.ScreenGui.ItemName
  11. local itemC = script.Parent.ScreenGui.ItemCost
  12. local Shop = script.Parent.ScreenGui.ShopButton
  13. local Pur = script.Parent.ScreenGui.PurchaseButton
  14. local Debounce = false
  15. local function movie()
  16. finished = workspace:FindFirstChild("Focus1")
  17. timed = 1
  18. itemN.Text = finished.Item.Value
  19. itemC.Text = "$"..finished.Cost.Value
  20. camera.CFrame = finished.CFrame
  21. game:GetService("RunService").RenderStepped:Wait()
  22. end
  23. Pur.MouseButton1Down:connect(function()
  24. finished = workspace:FindFirstChild("Focus"..timed)
  25. local cash = player.leaderstats.Cash
  26. char = player.Character
  27. local Tools = char:FindFirstChild("tool")
  28. if cash.Value >= finished.Cost.Value then
  29. if Tools then
  30. char.tool:Destroy()
  31. cash.Value = cash.Value - finished.Cost.Value
  32. local item = game.ReplicatedStorage:FindFirstChild(finished.Item.Value):Clone()
  33. item.Name = "tool"
  34. item.Parent = player.StarterGear
  35. item.Parent = player.Backpack
  36. else
  37. player.Backpack.tool:Destroy()
  38. cash.Value = cash.Value - finished.Cost.Value
  39. local item = game.ReplicatedStorage:FindFirstChild(finished.Item.Value):Clone()
  40. item.Name = "tool"
  41. item.Parent = player.StarterGear
  42. item.Parent = player.Backpack
  43. end
  44. end
  45. end)
  46. Shop.MouseButton1Click:connect(function()
  47. char = player.Character
  48. if Debounce == false then
  49. camera.CameraType = "Scriptable"
  50. Back.Visible = true
  51. For.Visible = true
  52. itemC.Visible = true
  53. itemN.Visible = true
  54. Pur.Visible = true
  55. Debounce = true
  56. movie()
  57. else
  58. game.Workspace.CurrentCamera.CameraSubject = game.Players.LocalPlayer.Character.Humanoid
  59. camera.CFrame = game.Players.LocalPlayer.Character.HumanoidRootPart.CFrame
  60. game.Workspace.CurrentCamera.CFrame = game.Players.LocalPlayer.Character.HumanoidRootPart.CFrame
  61. game.Workspace.CurrentCamera.CameraSubject = game.Players.LocalPlayer.Character.HumanoidRootPart
  62. wait(1)
  63. Back.Visible = false
  64. For.Visible = false
  65. itemC.Visible = false
  66. itemN.Visible = false
  67. Pur.Visible = false
  68. camera.CFrame = game.Players.LocalPlayer.Character.HumanoidRootPart.CFrame
  69. game.Workspace.CurrentCamera.CameraSubject = game.Players.LocalPlayer.Character.Humanoid
  70. camera.CameraType = Enum.CameraType.Custom
  71. Debounce = false
  72. game.Players.LocalPlayer.Character.Humanoid.Health = 0
  73. end
  74. end)
  75. For.MouseButton1Down:connect(function()
  76. timed = timed + 1
  77. if timed == 5 then
  78. timed = 1
  79. end
  80. finished = workspace:FindFirstChild("Focus"..timed)
  81. itemN.Text = finished.Item.Value
  82. itemC.Text = "$"..finished.Cost.Value
  83. for i = 0,1,0.001 do
  84. camera.CameraType = Enum.CameraType.Custom
  85. camera.CFrame = camera.CFrame:lerp(finished.CFrame,i)
  86. wait(0.01)
  87. end
  88. end)
  89. Back.MouseButton1Down:connect(function()
  90. timed = timed - 1
  91. if timed == 0 then
  92. timed = 4
  93. end
  94. finished = workspace:FindFirstChild("Focus"..timed)
  95. itemN.Text = finished.Item.Value
  96. itemC.Text = "$"..finished.Cost.Value
  97. for i = 0,1,0.001 do
  98. camera.CameraType = Enum.CameraType.Custom
  99. camera.CFrame = camera.CFrame:lerp(finished.CFrame,i)
  100. wait(0.01)
  101. end
  102. end)
RAW Paste Data