Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local plr = game:GetService("Players")
- local me = plr.LocalPlayer
- local hum = me.Character:WaitForChild("Humanoid")
- local hrp = me.Character:WaitForChild("HumanoidRootPart")
- local work = game:GetService("Workspace")
- local run = game:GetService("RunService")
- local camera = work.CurrentCamera
- local con
- local function update()
- hum = me.Character:WaitForChild("Humanoid")
- hrp = me.Character:WaitForChild("HumanoidRootPart")
- end
- me.CharacterAdded:Connect(update)
- if me.Character then
- update()
- end
- local screen = Instance.new("ScreenGui")
- screen.Parent = me.PlayerGui
- screen.Name = "Trash"
- local frame = Instance.new("Frame")
- frame.Parent = screen
- frame.Size = UDim2.new(0,250,0,250)
- frame.Position = UDim2.new(0,15,0,380)
- frame.Active = true
- frame.Selectable = true
- frame.Draggable = true
- local btn = Instance.new("TextButton")
- btn.Parent = frame
- btn.Size = UDim2.new(0,25,0,25)
- btn.Position = UDim2.new(0,225,0,0)
- btn.Text = "X"
- btn.TextSize = 12
- local text = Instance.new("TextBox")
- text.Parent = frame
- text.Size = UDim2.new(0,80,0,35)
- text.Position = UDim2.new(0,90,0,100)
- text.Text = ""
- text.PlaceholderText = "Trash"
- text.PlaceholderColor3 = Color3.fromRGB(70,70,70)
- text.TextSize = 12
- local btn2 = Instance.new("TextButton")
- btn2.Parent = frame
- btn2.Size = UDim2.new(0,80,0,35)
- btn2.Position = UDim2.new(0,30,0,140)
- btn2.Text = "Start"
- btn2.TextSize = 12
- local btn3 = Instance.new("TextButton")
- btn3.Parent = frame
- btn3.Size = UDim2.new(0,80,0,35)
- btn3.Position = UDim2.new(0,150,0,140)
- btn3.Text = "Stop"
- btn3.TextSize = 12
- btn.MouseButton1Click:Connect(function()
- screen:Destroy()
- end)
- btn2.MouseButton1Click:Connect(function()
- for _, allAnims in pairs(hum:GetPlayingAnimationTracks()) do
- allAnims:Stop()
- end
- local anim = Instance.new("Animation")
- anim.AnimationId = "rbxassetid://17141153099"
- local animtrack = hum.Animator:LoadAnimation(anim)
- animtrack:Play()
- local part = Instance.new("Part")
- part.Parent = work
- part.CanCollide = false
- part.Anchored = true
- part.Transparency = 0.999
- con = run.RenderStepped:Connect(function()
- part.CFrame = hrp.CFrame * CFrame.new(0,0,-3)
- camera.CameraSubject = part
- end)
- task.delay(0.75, function()
- animtrack:AdjustSpeed(0)
- end)
- btn3.MouseButton1Click:Connect(function()
- animtrack:Stop()
- if part then
- part:Destroy()
- end
- if con then
- con:Disconnect()
- con = nil
- camera.CameraSubject = me.Character
- end
- end)
- end)
- screen.ResetOnSpawn = false
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement