Advertisement
ERROR_CODE

Preview

Dec 5th, 2023 (edited)
129
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.97 KB | None | 0 0
  1. local ScreenGui = Instance.new("ScreenGui")
  2. local PreviewButton = Instance.new("TextButton")
  3. local PreviewPart = Instance.new("Part")
  4. local player = game.Players.LocalPlayer
  5. local character = player.Character
  6. local cam = workspace.CurrentCamera
  7. local Song = Instance.new("Sound")
  8. local Id = "15514405804"
  9. local Right = 0
  10. local Up = 0
  11. local Forward = 0
  12. local RR = 0
  13. local RU = 0
  14. local RF = 0
  15.  
  16. PreviewPart.Parent = workspace
  17. ScreenGui.Parent = game.CoreGui
  18.  
  19. cam.CameraType = Enum.CameraType.Attach
  20. cam.CameraSubject = PreviewPart
  21.  
  22. Song.Parent = game.Workspace
  23. Song.SoundId = "rbxassetid://"..Id
  24. Song.Playing = true
  25. Song.Looped = false
  26. Song.Volume = 1
  27. Song:Stop()
  28.  
  29. PreviewPart.Anchored = true
  30. PreviewPart.Size = Vector3.new(4, 1, 2)
  31. PreviewPart.CanCollide = false
  32. PreviewPart.Rotation = Vector3.new(0, 180, 0)
  33. PreviewPart.Position = Vector3.new(54.371, 909.478, 269)
  34. PreviewPart.Transparency = 1
  35. PreviewPart.Rotation = Vector3.new(0, 90, 0)
  36.  
  37. PreviewButton.Name = "PreviewButton"
  38. PreviewButton.Parent = ScreenGui
  39. PreviewButton.BackgroundTransparency = 1
  40. PreviewButton.Position = UDim2.new(0.45, 0, 0.8, 0)
  41. PreviewButton.Size = UDim2.new(0, 125, 0, 50)
  42. PreviewButton.Font = Enum.Font.IndieFlower
  43. PreviewButton.Text = "Preview"
  44. PreviewButton.TextColor3 = Color3.fromRGB(255, 255, 255)
  45. PreviewButton.TextSize = 100
  46. PreviewButton.MouseButton1Down:connect(function()
  47. Song:Play()
  48. PreviewButton.Visible = false
  49. for i = 1,900 do
  50. wait()
  51. Right = Right - 0.1
  52. --Forward = Forward + 0.5
  53. --Up = Up + 0.5
  54. PreviewPart.CFrame = PreviewPart.CFrame + Vector3.new(Right, Up, Forward)
  55. Right = 0
  56. Forward = 0
  57. Up = 0
  58. end
  59. --[[for i = 1,100 do
  60. wait()
  61. RU = RU - 0.5
  62. PreviewPart.Rotation = PreviewPart.Rotation + Vector3.new(RR, RU, RF)
  63. RR = 0
  64. RU = 0
  65. RF = 0
  66. end
  67. for i = 1,100 do
  68. wait()
  69. RU = RU + 0.5
  70. PreviewPart.Rotation = PreviewPart.Rotation + Vector3.new(RR, RU, RF)
  71. RR = 0
  72. RU = 0
  73. RF = 0
  74. end]]--
  75. cam.CameraSubject = character
  76. cam.CameraType = Enum.CameraType.Track
  77. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement