Advertisement
FROSTYOO7

Shinjuku 1988 Roblox Part ESP script

Mar 7th, 2025 (edited)
555
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 6.83 KB | Source Code | 0 0
  1. local Players = game:GetService("Players")
  2. local LocalPlayer = Players.LocalPlayer
  3. local PlayerGui = LocalPlayer:WaitForChild("PlayerGui")
  4. local Workspace = game:GetService("Workspace")
  5.  
  6. -- Objects to track with their respective label colors
  7. local objects = {
  8.     {Name = "Fireaxe", Label = "Fireaxe", Color = Color3.new(1, 0, 0)},         -- Red
  9.     {Name = "Sledgehammer", Label = "Sledgehammer", Color = Color3.new(0, 1, 0)}, -- Green
  10.     {Name = "MP5", Label = "MP5", Color = Color3.new(1, 1, 0)},                  -- Yellow
  11.     {Name = "Mossberg", Label = "Mossberg", Color = Color3.new(1, 0, 1)},        -- Magenta
  12.     {Name = "P9", Label = "P9", Color = Color3.new(0, 1, 1)},                     -- Cyan
  13.     {Name = "Howa", Label = "Howa", Color = Color3.new(1, 0.5, 0)},              -- Orange
  14. }
  15.  
  16. -- ESP State Management
  17. local espStates = {}
  18.  
  19. -- Function to determine if an object should be displayed in the ESP
  20. local function isPickupable(model)
  21.     return model:IsA("Model") -- Ensure the object is a model
  22. end
  23.  
  24. -- Function to create a styled BillboardGui for ESP display
  25. local function createESPLabel(object, label, color)
  26.     -- Avoid duplicates
  27.     if object:FindFirstChildOfClass("BillboardGui") then
  28.         object:FindFirstChildOfClass("BillboardGui"):Destroy() -- Clear outdated text
  29.     end
  30.  
  31.     local billboardGui = Instance.new("BillboardGui")
  32.     billboardGui.Adornee = object.PrimaryPart or object:FindFirstChildWhichIsA("BasePart")
  33.     if not billboardGui.Adornee then
  34.         warn("No valid Adornee for object:", object.Name)
  35.         return
  36.     end
  37.     billboardGui.Size = UDim2.new(10, 0, 5, 0)
  38.     billboardGui.StudsOffset = Vector3.new(0, 5, 0)
  39.     billboardGui.AlwaysOnTop = true
  40.     billboardGui.Parent = object
  41.  
  42. -- ESP Text Label
  43. local textLabel = Instance.new("TextLabel")
  44. textLabel.Size = UDim2.new(1.5, 0, 1.5, 0) -- Increased size for larger text display
  45. textLabel.BackgroundTransparency = 1
  46. textLabel.BackgroundColor3 = Color3.new(1, 0, 0) -- Black background for contrast
  47. textLabel.Text = label
  48. textLabel.TextColor3 = color
  49. textLabel.TextSize = 40 -- Explicitly set a larger text size
  50. textLabel.Font = Enum.Font.Oswald
  51. textLabel.Parent = billboardGui
  52.  
  53. -- Optional: Add a UIAspectRatioConstraint for better scaling
  54. local aspectRatio = Instance.new("UIAspectRatioConstraint")
  55. aspectRatio.AspectRatio = 2 -- Adjust based on desired width-to-height ratio
  56. aspectRatio.Parent = textLabel
  57.  
  58.     -- Rounded corners for the text label
  59.     local corner = Instance.new("UICorner")
  60.     corner.CornerRadius = UDim.new(0, 12)
  61.     corner.Parent = textLabel
  62.  
  63. end
  64.  
  65. -- Function to toggle ESP for a specific object
  66. local function toggleESP(objectName, button)
  67.     espStates[objectName] = not espStates[objectName]
  68.     local isVisible = espStates[objectName]
  69.  
  70.     for _, obj in ipairs(Workspace:GetChildren()) do
  71.         if obj.Name == objectName and obj:FindFirstChildOfClass("BillboardGui") then
  72.             obj:FindFirstChildOfClass("BillboardGui").Enabled = isVisible
  73.         end
  74.     end
  75.  
  76.     if isVisible then
  77.         button.BackgroundColor3 = Color3.new(0, 1, 0) -- Green (On)
  78.         button.Text = objectName .. " ESP (On)"
  79.     else
  80.         button.BackgroundColor3 = Color3.new(1, 0, 0) -- Red (Off)
  81.         button.Text = objectName .. " ESP (Off)"
  82.     end
  83. end
  84.  
  85. -- GUI Creation with Scrollable Frame (Untouched)
  86. local screenGui = Instance.new("ScreenGui")
  87. screenGui.Parent = PlayerGui
  88.  
  89. local mainFrame = Instance.new("Frame")
  90. mainFrame.Size = UDim2.new(0, 350, 0, 400)
  91. mainFrame.Position = UDim2.new(0.5, 0, 0.5, 0)
  92. mainFrame.AnchorPoint = Vector2.new(0.5, 0.5)
  93. mainFrame.BackgroundColor3 = Color3.fromRGB(40, 40, 40)
  94. mainFrame.BorderSizePixel = 0
  95. mainFrame.Parent = screenGui
  96. mainFrame.Active = true
  97. mainFrame.Draggable = true
  98.  
  99. local corner = Instance.new("UICorner")
  100. corner.CornerRadius = UDim.new(0, 10)
  101. corner.Parent = mainFrame
  102.  
  103. -- Title Bar
  104. local titleBar = Instance.new("Frame")
  105. titleBar.Size = UDim2.new(1, 0, 0, 40)
  106. titleBar.BackgroundColor3 = Color3.fromRGB(50, 50, 50)
  107. titleBar.BorderSizePixel = 0
  108. titleBar.Parent = mainFrame
  109.  
  110. local titleText = Instance.new("TextLabel")
  111. titleText.Size = UDim2.new(1, 0, 1, 0)
  112. titleText.BackgroundTransparency = 0
  113. titleText.BackgroundColor3 = Color3.new(0, 0, 0)
  114. titleText.Text = "Shinjuku Item ESP"
  115. titleText.TextColor3 = Color3.fromRGB(255, 255, 255)
  116. titleText.TextScaled = true
  117. titleText.Font = Enum.Font.Oswald
  118. titleText.Parent = titleBar
  119.  
  120. -- Close Button
  121. local closeButton = Instance.new("TextButton")
  122. closeButton.Size = UDim2.new(0, 30, 0, 30)
  123. closeButton.Position = UDim2.new(1, -5, 0.5, 0)
  124. closeButton.AnchorPoint = Vector2.new(1, 0.5)
  125. closeButton.BackgroundColor3 = Color3.fromRGB(255, 85, 85)
  126. closeButton.Text = "X"
  127. closeButton.TextColor3 = Color3.new(1, 1, 1)
  128. closeButton.TextScaled = true
  129. closeButton.Font = Enum.Font.Oswald
  130. closeButton.Parent = titleBar
  131.  
  132. local closeCorner = Instance.new("UICorner")
  133. closeCorner.CornerRadius = UDim.new(0, 5)
  134. closeCorner.Parent = closeButton
  135.  
  136. -- Close Button Functionality
  137. closeButton.MouseButton1Click:Connect(function()
  138.     screenGui:Destroy()
  139. end)
  140.  
  141. -- Scrollable Frame for Buttons
  142. local scrollFrame = Instance.new("ScrollingFrame")
  143. scrollFrame.Size = UDim2.new(1, 0, 1, -40)
  144. scrollFrame.Position = UDim2.new(0, 0, 0, 40)
  145. scrollFrame.CanvasSize = UDim2.new(0, 0, 0, #objects * 60)
  146. scrollFrame.BackgroundTransparency = 1
  147. scrollFrame.ScrollBarThickness = 10
  148. scrollFrame.ScrollBarImageColor3 = Color3.fromRGB(100, 100, 100)
  149. scrollFrame.Parent = mainFrame
  150.  
  151. local layout = Instance.new("UIListLayout")
  152. layout.Padding = UDim.new(0, 10)
  153. layout.FillDirection = Enum.FillDirection.Vertical
  154. layout.HorizontalAlignment = Enum.HorizontalAlignment.Center
  155. layout.SortOrder = Enum.SortOrder.LayoutOrder
  156. layout.Parent = scrollFrame
  157.  
  158. -- Create Buttons for ESP Toggle
  159. for _, obj in ipairs(objects) do
  160.     local button = Instance.new("TextButton")
  161.     button.Size = UDim2.new(0.9, 0, 0, 50)
  162.     button.BackgroundColor3 = Color3.fromRGB(50, 50, 50)
  163.     button.Text = obj.Label .. " (Off)"
  164.     button.TextColor3 = Color3.fromRGB(255, 255, 255)
  165.     button.TextScaled = true
  166.     button.Font = Enum.Font.Oswald
  167.     button.Parent = scrollFrame
  168.     espStates[obj.Name] = false
  169.  
  170.     button.MouseButton1Click:Connect(function()
  171.         toggleESP(obj.Name, button)
  172.     end)
  173.  
  174.     for _, descendant in ipairs(Workspace:GetChildren()) do
  175.         if descendant.Name == obj.Name and isPickupable(descendant) then
  176.             createESPLabel(descendant, obj.Label, obj.Color)
  177.         end
  178.     end
  179. end
  180.  
  181. -- Dynamically handle new objects
  182. Workspace.ChildAdded:Connect(function(child)
  183.     for _, obj in ipairs(objects) do
  184.         if child.Name == obj.Name and isPickupable(child) then
  185.             print("New pickupable object detected:", child.Name)
  186.             createESPLabel(child, obj.Label, obj.Color)
  187.         end
  188.     end
  189. end)
Tags: Roblox Script
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement