Filipono120

[Roblox] Cutscene Editor (v1.1)

Oct 18th, 2020 (edited)
846
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. --Cutscene Editor
  2. --Made by Filipono120 Studios
  3. --Tested and 100% worked on studio!
  4.  
  5. --Version 1.1:
  6. --| Fixed camera positioning...
  7. --| Thanks for 700 views!
  8.  
  9. --If you have ideas, message me on roblox...
  10.  
  11. wait(1 / 60)
  12.  
  13. --Waypoint Settings
  14. local WAYPOINT_COUNT = 0 --Starts and adds an waypoint with a number (integer)
  15. local Y_OFFSET = 2
  16. local Z_OFFSET = 0
  17. local PlaceKeycode = "Q" --Change the hotkey if you want
  18. local ClearKeycode = "R" --Change the hotkey if you want
  19. local PlayKeycode = "E" --Change the hotkey if you want
  20. local WaitKeycode = "Z" --Change the hotkey if you want
  21. local DurationKeycode = "F" --Change the hotkey if you want
  22. local YOffsetKeycode = "X" --Change the hotkey if you want
  23. local ZOffsetKeycode = "C" --Change the hotkey if you want
  24. local RotationKeycode = "V" --Change the hotkey if you want
  25. local RandomWaypointColor = false --Changes the waypoint color randomly...
  26. local WaitInt = 10
  27. local Rotation = 180
  28.  
  29. local TimeDuration = 1.5 --Change it later...
  30.  
  31. --Player Settings
  32. local PLACING_METHOD = 1 --[[
  33.  
  34.     Methods:
  35.    
  36.     (0) - ~Player Placement~
  37.     (1) - ~Mouse Placement~
  38.  
  39. ]]
  40. local plr = game.Players.LocalPlayer
  41. local char = plr.Character
  42. local mouse = plr:GetMouse()
  43. local UIS = game:GetService("UserInputService")
  44. local RS = game:GetService("RunService")
  45. local TS = game:GetService("TweenService")
  46.  
  47. --Wedge
  48. local wedge = Instance.new("WedgePart", workspace)
  49. wedge.Name = "WedgeSelectorPart"
  50. wedge.Size = Vector3.new(1.5, 1.5, 1.5)
  51.  
  52. --Functions
  53. local function CreateWayPoint(Pos, Name, Anchorable, CanCollide)
  54.     local WaypointModel = Instance.new("Model", workspace)
  55.     WaypointModel.Name = "Waypoint_"..WAYPOINT_COUNT
  56.     local WaypointPart = Instance.new("Part", WaypointModel)
  57.     WaypointModel.PrimaryPart = WaypointPart
  58.     WaypointPart.Size = Vector3.new(2.5, 2.5, 2.5)
  59.     WaypointPart.Material = Enum.Material.Neon
  60.     WaypointPart.Reflectance = 0.45
  61.     WaypointPart.Transparency = 0.75
  62.     WaypointPart.Position = Pos
  63.     WaypointPart.Anchored = Anchorable
  64.     WaypointPart.CanCollide = CanCollide
  65.     WaypointPart.Name = Name
  66.     local Humanoid = Instance.new("Humanoid", WaypointModel)
  67.     Humanoid.Name = "WaypointHumanoidTag"
  68.     Humanoid.NameDisplayDistance = 20
  69.     Humanoid.NameOcclusion = Enum.NameOcclusion.OccludeAll
  70.     if RandomWaypointColor then
  71.         local RandomColor = BrickColor.Random()
  72.         WaypointPart.BrickColor = RandomColor
  73.     end
  74.     if PLACING_METHOD == 1 then
  75.         WaypointModel.PrimaryPart.Position = Vector3.new(mouse.Hit.X, math.floor(mouse.Hit.Y + Y_OFFSET), mouse.Hit.Z + Z_OFFSET)
  76.         WaypointModel.PrimaryPart.Orientation = Vector3.new(0, wedge.Orientation.Y, 0)
  77.     elseif PLACING_METHOD == 0 then
  78.         WaypointModel.PrimaryPart.Position = Vector3.new(char["HumanoidRootPart"].Position.X, char["HumanoidRootPart"].Position.Y + Y_OFFSET, char["HumanoidRootPart"].Position.Z + Z_OFFSET)
  79.         WaypointModel.PrimaryPart.Orientation = Vector3.new(0, Rotation, 0)
  80.     end
  81. end
  82.  
  83. local function PlayAnimation()
  84.     local models = workspace
  85.     local modelChild = models:GetChildren()
  86.     table.sort(modelChild, function(a, b) return a:GetFullName() < b:GetFullName() end)
  87.  
  88.     for _, model in pairs(modelChild) do
  89.         if string.match(model.Name, "Waypoint") and model.PrimaryPart then
  90.             local PrimaryPart = model.PrimaryPart
  91.             local Camera = workspace.CurrentCamera
  92.             Camera.CameraType = Enum.CameraType.Scriptable
  93.  
  94.             local tween = TS:Create(
  95.  
  96.                 Camera,
  97.                 TweenInfo.new(TimeDuration, Enum.EasingStyle.Exponential, Enum.EasingDirection.In),
  98.                 {
  99.                     CFrame = CFrame.new(PrimaryPart.CFrame.X, PrimaryPart.CFrame.Y + Y_OFFSET, PrimaryPart.CFrame.Z + Z_OFFSET) * CFrame.Angles(0, PrimaryPart.Orientation.Y / 0.3, 0);
  100.                     Focus = CFrame.new(0, 0, 100);
  101.                 }
  102.  
  103.             )
  104.             tween:Play()
  105.             tween.Completed:Wait()
  106.             wait(WaitInt)
  107.             Camera.CameraType = Enum.CameraType.Custom
  108.         end
  109.     end
  110. end
  111.  
  112. --RBXScriptSignal Events
  113.  
  114. UIS.InputBegan:Connect(function(input, GPE)
  115.     if GPE then return end
  116.     if input.KeyCode == Enum.KeyCode[PlaceKeycode] then
  117.         WAYPOINT_COUNT = WAYPOINT_COUNT + 1
  118.         CreateWayPoint(Vector3.new(-43.85, 1.25, -9.95), "Head", true, false)
  119.     elseif input.KeyCode == Enum.KeyCode[DurationKeycode] then
  120.         if TimeDuration >= 4.1 then
  121.             TimeDuration = .1
  122.         end
  123.         TimeDuration = TimeDuration + .1
  124.         game.StarterGui:SetCore("SendNotification", {
  125.             Title = "[CUTSCENE EDITOR]";
  126.             Text = "The tween duration has been changed to "..TimeDuration;
  127.             Icon = "";
  128.             Duration = 5;
  129.         })
  130.     elseif input.KeyCode == Enum.KeyCode[YOffsetKeycode] then
  131.         if Y_OFFSET >= 10 then
  132.             Y_OFFSET = 1
  133.         end
  134.         Y_OFFSET = Y_OFFSET + 1
  135.         game.StarterGui:SetCore("SendNotification", {
  136.             Title = "[CUTSCENE EDITOR]";
  137.             Text = "The Y Offset has been changed to "..Y_OFFSET;
  138.             Icon = "";
  139.             Duration = 5;
  140.         })
  141.     elseif input.KeyCode == Enum.KeyCode[ZOffsetKeycode] then
  142.         if Z_OFFSET >= 10 then
  143.             Z_OFFSET = -1
  144.         end
  145.         Z_OFFSET = Z_OFFSET + 1
  146.         game.StarterGui:SetCore("SendNotification", {
  147.             Title = "[CUTSCENE EDITOR]";
  148.             Text = "The Z Offset has been changed to "..Z_OFFSET;
  149.             Icon = "";
  150.             Duration = 5;
  151.         })
  152.     elseif input.KeyCode == Enum.KeyCode[WaitKeycode] then
  153.         if WaitInt >= 10 then
  154.             WaitInt = 0
  155.         end
  156.         WaitInt = WaitInt + 1
  157.         game.StarterGui:SetCore("SendNotification", {
  158.             Title = "[CUTSCENE EDITOR]";
  159.             Text = "The wait integer has been changed to "..WaitInt;
  160.             Icon = "";
  161.             Duration = 5;
  162.         })
  163.     elseif input.KeyCode == Enum.KeyCode[RotationKeycode] then
  164.         if Rotation >= 360 then
  165.             Rotation = 0
  166.         end
  167.         Rotation = Rotation + 90
  168.         game.StarterGui:SetCore("SendNotification", {
  169.             Title = "[CUTSCENE EDITOR]";
  170.             Text = "The rotation has been changed to "..Rotation;
  171.             Icon = "";
  172.             Duration = 5;
  173.         })
  174.     elseif input.KeyCode == Enum.KeyCode[PlayKeycode] then
  175.         PlayAnimation()
  176.     elseif input.KeyCode == Enum.KeyCode[ClearKeycode] then
  177.         for _, mod in pairs(workspace:GetChildren()) do
  178.             if mod:IsA("Model") and string.match(mod.Name, "Waypoint") then
  179.                 mod:Destroy()
  180.                 WAYPOINT_COUNT = 0
  181.             end
  182.         end
  183.     end
  184. end)
  185.  
  186. RS.RenderStepped:Connect(function()
  187.     if PLACING_METHOD == 1 then
  188.         wedge.Orientation = Vector3.new(0, Rotation, 0)
  189.         wedge.Transparency = 0.5
  190.         wedge.Material = Enum.Material.Neon
  191.         wedge.Position = Vector3.new(mouse.Hit.X, math.floor(mouse.Hit.Y + Y_OFFSET), mouse.Hit.Z + Z_OFFSET)
  192.         wedge.Anchored = true
  193.         wedge.CanCollide = false
  194.     elseif PLACING_METHOD == 0 then
  195.         wedge.Orientation = Vector3.new(0, Rotation, 0)
  196.         wedge.Transparency = 0.5
  197.         wedge.Material = Enum.Material.Neon
  198.         wedge.Position = Vector3.new(char["HumanoidRootPart"].Position.X, char["HumanoidRootPart"].Position.Y + Y_OFFSET, char["HumanoidRootPart"].Position.Z + Z_OFFSET)
  199.         wedge.Anchored = true
  200.         wedge.CanCollide = false
  201.     end
  202. end)
  203.  
  204. char["Humanoid"].Died:Connect(function()
  205.     for _, mod in pairs(workspace:GetChildren()) do
  206.         if mod:IsA("Model") and string.match(mod.Name, "Waypoint") then
  207.             mod:Destroy()
  208.             WAYPOINT_COUNT = 0
  209.         end
  210.     end
  211. end)
RAW Paste Data