Advertisement
Joriangames

Cutscene Handler

Aug 13th, 2022
1,155
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 2.98 KB | None | 0 0
  1. --[[
  2. Thanks for using this script
  3. This script was made by Joriangames/BloxianCode
  4. Want to know how to use this and script explanation?
  5. Check the video here: https://youtu.be/iegUPV-wMng
  6. ]]
  7. --CUTSCENE HANDELER by BloxianCoder
  8.  
  9. local player = game.Players.LocalPlayer
  10. local char = player.Character or player.CharacterAdded:Wait()
  11. local hum = char:WaitForChild("Humanoid")
  12. local TransitionScreen = script.Parent.TransitionScreen
  13.  
  14. local CutsceneFolder = workspace.CutsceneSetup
  15.  
  16. local TweenService = game:GetService("TweenService")
  17.  
  18. local cam = workspace.CurrentCamera
  19.  
  20. local function startCutscene()
  21.     cam.CameraType = Enum.CameraType.Scriptable
  22.     script.Parent.Sounds.BackgroundSound:Play()
  23.    
  24.     script.Parent.TextFrame.Visible = true
  25.  
  26.     hum.WalkSpeed = 0
  27.     hum:SetStateEnabled(Enum.HumanoidStateType.Jumping, false)
  28. end
  29.  
  30. local function posCamera(Position)
  31.     cam.CFrame = Position
  32. end
  33.  
  34. local function posAvatar(character, position)
  35.     character.Parent = workspace
  36.     character.HumanoidRootPart.CFrame = position
  37. end
  38.  
  39. local function TweenCam(newPosition, delayTime)
  40.     local CamTweening = TweenService:Create(cam, TweenInfo.new(delayTime), {CFrame = newPosition})
  41.     CamTweening:Play()
  42. end
  43.  
  44. local function ChangeName(nametext, color)
  45.     local NameLabel = script.Parent.TextFrame.CharName
  46.     NameLabel.Text = nametext
  47.    
  48.     if color then
  49.         NameLabel.TextColor3 = color
  50.     end
  51. end
  52.  
  53. local function ChangeText(msg, color)
  54.     local Talkinglabel = script.Parent.TextFrame.BehindTalking.Talking
  55.    
  56.     if color then
  57.         Talkinglabel.TextColor3 = color
  58.     end
  59.    
  60.     for i=1, #msg do
  61.         Talkinglabel.Text = string.sub(msg, 1, i)
  62.         wait(0.1 / #msg)
  63.     end
  64. end
  65.  
  66.  
  67.  
  68. --[CUTSCENE SCRIPT STARTS HERE]
  69.  
  70. startCutscene()
  71. posCamera(CutsceneFolder.CamPos.CFrame)
  72. posAvatar(char, CutsceneFolder.PlayerPos.CFrame)
  73.  
  74.  
  75. ChangeName(player.Name, Color3.new(255, 255, 255))
  76. ChangeText("So you wanted to know how to do this right? Well listen..", Color3.new(0.356863, 0.368627, 0.615686))
  77. wait(5)
  78.  
  79. TweenCam(CutsceneFolder.CamPos2.CFrame, 0.5)
  80. ChangeName("Owner", Color3.new(0.0745098, 0.211765, 1))
  81. ChangeText("You just have to subscribe to stay up-to-date with the latest videos", Color3.new(255, 255, 255))
  82. wait(5)
  83.  
  84. TweenCam(CutsceneFolder.CamPos3.CFrame, 0.5)
  85. ChangeName("Enjoy", Color3.new(0.0745098, 0.211765, 1))
  86. ChangeText("Enjoy the game, don't forget to like it!", Color3.new(255, 255, 255))
  87. wait(2)
  88.  
  89.  
  90.  
  91.  
  92. --END OF CUTSCENE. Sets camera and player to normal settings
  93. script.Parent.TextFrame.Visible = false
  94.  
  95. for i = 1,0,-.1 do
  96.     TransitionScreen.BackgroundTransparency = i
  97.     wait(.1)
  98. end
  99.  
  100. script.Parent.Sounds.BackgroundSound:Stop()
  101. char.HumanoidRootPart.CFrame = workspace.CutsceneSetup.StartLocation.CFrame
  102.  
  103.  
  104. cam.CameraType = Enum.CameraType.Custom
  105. cam.CameraSubject = hum
  106. cam.FieldOfView = 70
  107.  
  108. hum.WalkSpeed = 16
  109. hum:SetStateEnabled(Enum.HumanoidStateType.Jumping, true)
  110.  
  111.  
  112. for i = 0,1,.1 do
  113.     TransitionScreen.BackgroundTransparency = i
  114.     wait(.1)
  115. end
  116.  
  117. script.Parent.Enabled = false
  118. script.Disabled = true
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement