Advertisement
MayWeEnjoy

Fe bang v2 script by pystyt

Dec 21st, 2024 (edited)
204,714
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 6.12 KB | None | 0 0
  1. -- by pyst
  2. local Players = game:GetService("Players")
  3. local LocalPlayer = Players.LocalPlayer
  4. local UserInputService = game:GetService("UserInputService")
  5.  
  6. -- Create the ScreenGui
  7. local ScreenGui = Instance.new("ScreenGui")
  8. ScreenGui.Parent = game.CoreGui
  9. ScreenGui.Name = "ModernGUI"
  10.  
  11. -- Main Frame
  12. local MainFrame = Instance.new("Frame")
  13. MainFrame.Parent = ScreenGui
  14. MainFrame.Size = UDim2.new(0, 300, 0, 150)
  15. MainFrame.Position = UDim2.new(0.5, -150, 0.5, -75)
  16. MainFrame.BackgroundColor3 = Color3.fromRGB(35, 35, 35)
  17. MainFrame.BorderSizePixel = 0
  18. MainFrame.Draggable = true
  19. MainFrame.Active = true
  20.  
  21. -- Squircle Shape
  22. local UICorner = Instance.new("UICorner")
  23. UICorner.Parent = MainFrame
  24. UICorner.CornerRadius = UDim.new(0, 20)
  25.  
  26. -- Title Bar
  27. local TitleBar = Instance.new("Frame")
  28. TitleBar.Parent = MainFrame
  29. TitleBar.Size = UDim2.new(1, 0, 0, 25)
  30. TitleBar.BackgroundColor3 = Color3.fromRGB(50, 50, 50)
  31. TitleBar.BorderSizePixel = 0
  32.  
  33. -- Title Label
  34. local TitleLabel = Instance.new("TextLabel")
  35. TitleLabel.Parent = TitleBar
  36. TitleLabel.Size = UDim2.new(0, 50, 1, 0)
  37. TitleLabel.Position = UDim2.new(0, 5, 0, 0)
  38. TitleLabel.Text = "Bang V2"
  39. TitleLabel.TextColor3 = Color3.fromRGB(255, 255, 255)
  40. TitleLabel.BackgroundTransparency = 1
  41. TitleLabel.TextSize = 14
  42.  
  43. -- Close Button
  44. local CloseButton = Instance.new("TextButton")
  45. CloseButton.Parent = TitleBar
  46. CloseButton.Size = UDim2.new(0, 25, 1, 0)
  47. CloseButton.Position = UDim2.new(1, -25, 0, 0)
  48. CloseButton.Text = "X"
  49. CloseButton.TextColor3 = Color3.fromRGB(255, 255, 255)
  50. CloseButton.BackgroundColor3 = Color3.fromRGB(200, 50, 50)
  51. CloseButton.BorderSizePixel = 0
  52. CloseButton.MouseButton1Click:Connect(function()
  53. ScreenGui:Destroy()
  54. end)
  55.  
  56. -- Minimize Button
  57. local MinimizeButton = Instance.new("TextButton")
  58. MinimizeButton.Parent = TitleBar
  59. MinimizeButton.Size = UDim2.new(0, 50, 1, 0)
  60. MinimizeButton.Position = UDim2.new(1, -75, 0, 0)
  61. MinimizeButton.Text = "Hide"
  62. MinimizeButton.TextColor3 = Color3.fromRGB(255, 255, 255)
  63. MinimizeButton.BackgroundColor3 = Color3.fromRGB(100, 100, 100)
  64. MinimizeButton.BorderSizePixel = 0
  65.  
  66. local minimized = false
  67. MinimizeButton.MouseButton1Click:Connect(function()
  68. if not minimized then
  69. MainFrame.Size = UDim2.new(0, 300, 0, 25)
  70. MinimizeButton.Text = "Show"
  71. else
  72. MainFrame.Size = UDim2.new(0, 300, 0, 150)
  73. MinimizeButton.Text = "Hide"
  74. end
  75. minimized = not minimized
  76. end)
  77.  
  78. -- Text Box
  79. local TargetTextBox = Instance.new("TextBox")
  80. TargetTextBox.Parent = MainFrame
  81. TargetTextBox.Size = UDim2.new(0.9, 0, 0, 30)
  82. TargetTextBox.Position = UDim2.new(0.05, 0, 0.3, 0)
  83. TargetTextBox.PlaceholderText = "Enter target name"
  84. TargetTextBox.Text = ""
  85. TargetTextBox.TextColor3 = Color3.fromRGB(255, 255, 255)
  86. TargetTextBox.BackgroundColor3 = Color3.fromRGB(45, 45, 45)
  87. TargetTextBox.BorderSizePixel = 0
  88.  
  89. -- Toggle Button
  90. local ToggleButton = Instance.new("TextButton")
  91. ToggleButton.Parent = MainFrame
  92. ToggleButton.Size = UDim2.new(0.9, 0, 0, 30)
  93. ToggleButton.Position = UDim2.new(0.05, 0, 0.6, 0)
  94. ToggleButton.Text = "Start"
  95. ToggleButton.TextColor3 = Color3.fromRGB(255, 255, 255)
  96. ToggleButton.BackgroundColor3 = Color3.fromRGB(70, 130, 180)
  97. ToggleButton.BorderSizePixel = 0
  98.  
  99. -- Functionality
  100. local following = false
  101. local targetPlayer = nil
  102. local animationId = "189854234" -- 182789003 use this id if u prefer
  103.  
  104. ToggleButton.MouseButton1Click:Connect(function()
  105. if not following then
  106. -- Start following
  107. local targetName = TargetTextBox.Text:lower()
  108. targetPlayer = nil
  109.  
  110. for _, player in pairs(Players:GetPlayers()) do
  111. if player.Name:lower():find(targetName) or player.DisplayName:lower():find(targetName) then
  112. targetPlayer = player
  113. break
  114. end
  115. end
  116.  
  117. if targetPlayer and targetPlayer.Character then
  118. following = true
  119. ToggleButton.Text = "Stop"
  120.  
  121. -- Animation
  122. local humanoid = LocalPlayer.Character:FindFirstChildOfClass("Humanoid")
  123. local animation = Instance.new("Animation")
  124. animation.AnimationId = "rbxassetid://" .. animationId
  125. local animator = humanoid:LoadAnimation(animation)
  126.  
  127. coroutine.wrap(function()
  128. local lastCFrame = nil
  129. while following do
  130. local targetCharacter = targetPlayer.Character
  131. if targetCharacter and targetCharacter.PrimaryPart then
  132. local targetCFrame = targetCharacter.PrimaryPart.CFrame
  133.  
  134. -- Position your character behind and face the target
  135. local followCFrame = targetCFrame * CFrame.new(0, 0, 1.2) -- Slightly closer to the target
  136.  
  137. if not lastCFrame or (followCFrame.Position - lastCFrame.Position).Magnitude > 0.1 or
  138. (followCFrame.LookVector - lastCFrame.LookVector).Magnitude > 0.1 then
  139. lastCFrame = followCFrame
  140.  
  141. -- Move behind the target and face it
  142. LocalPlayer.Character:SetPrimaryPartCFrame(
  143. CFrame.new(followCFrame.Position) *
  144. CFrame.Angles(0, math.atan2(-targetCFrame.LookVector.X, -targetCFrame.LookVector.Z), 0)
  145. )
  146. end
  147.  
  148. -- Play animation
  149. animator:Play()
  150. task.wait(0.1)
  151. animator:Stop()
  152. task.wait(0.1)
  153. else
  154. -- Stop if target is invalid
  155. following = false
  156. ToggleButton.Text = "Start"
  157. break
  158. end
  159. end
  160. end)()
  161. else
  162. print("Target not found!")
  163. end
  164. else
  165. -- Stop following
  166. following = false
  167. ToggleButton.Text = "Start"
  168. end
  169. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement