Dark_Agent

ai pp script for mic up

Nov 27th, 2026 (edited)
48
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 11.65 KB | Gaming | 0 0
  1. --[[--
  2. Made by Farhat and Pio with love.
  3. Compiled with Gemini AI lol to make this perfect script.
  4. --]]--
  5.  
  6. --!optimize 2
  7. --!native
  8.  
  9. if not game:IsLoaded() then game.Loaded:Wait() end
  10.  
  11. local function missing(t: string, f: any, fallback: any): any
  12.     if type(f) == t then
  13.         return f
  14.     end
  15.     return fallback
  16. end
  17.  
  18. local cloneref = missing("function", cloneref, function(...)
  19.     return ...
  20. end)
  21. local setscriptable = missing("function", setscriptable or set_scriptable, function(...)
  22.     return ...
  23. end)
  24. local isscriptable = missing("function", isscriptable or is_scriptable, function(...)
  25.     return false
  26. end)
  27.  
  28. local sethidden = missing("function", sethiddenproperty or set_hidden_property or set_hidden_prop, function(obj, prop, arg)
  29.     if isscriptable(obj, prop) == false then
  30.         setscriptable(obj, prop, true)
  31.         obj[prop] = arg
  32.         setscriptable(obj, prop, false)
  33.     else
  34.         obj[prop] = arg
  35.     end
  36. end)
  37.  
  38. local gethidden = missing("function", gethiddenproperty or get_hidden_property or get_hidden_prop, function(obj, prop)
  39.     if isscriptable(obj, prop) == false then
  40.         setscriptable(obj, prop, true)
  41.         local val = obj[prop]
  42.         setscriptable(obj, prop, false)
  43.         return val, true
  44.     else
  45.         return obj[prop], isscriptable(obj, prop)
  46.     end
  47. end)
  48.  
  49. local getgenv = missing("function", getgenv or get_genv, function()
  50.     if _G then
  51.         return _G
  52.     elseif shared then
  53.         return shared
  54.     else
  55.         return {}
  56.     end
  57. end)
  58.  
  59. local Services = setmetatable({}, {
  60.     __index = function(self, name: string)
  61.         local success, cache = pcall(function()
  62.             return cloneref(game:GetService(name))
  63.         end)
  64.         if success then
  65.             rawset(self, name, cache)
  66.             return cache
  67.         else
  68.             error("Invalid Service: " .. tostring(name))
  69.         end
  70.     end,
  71. })
  72.  
  73. -- getgenv()["ppsetings"] = {["colorA"] = "yellow", ["colorB"] = "black", ["vsize"] = Vector3.new(1, 6, 1) * 1}
  74.  
  75. local colorA = getgenv()["ppsetings"]["colorA"] or "yellow"
  76. local colorB = getgenv()["ppsetings"]["colorB"] or "black"
  77. local vsize = getgenv()["ppsetings"]["vsize"] or Vector3.new(1, 6, 1) * 1
  78.  
  79. local ReplicatedStorage: ReplicatedStorage = Services.ReplicatedStorage
  80. local Players: Players = Services.Players
  81. local UserInputService: UserInputService = Services.UserInputService
  82. local RunService: RunService = Services.RunService
  83.  
  84. local PreSimulation = RunService.PreSimulation
  85. local PostSimulation = RunService.PostSimulation
  86.  
  87. local LocalPlayer: Player = Players.LocalPlayer
  88. local mouse = LocalPlayer:GetMouse()
  89.  
  90. local event_generation = ReplicatedStorage:WaitForChild("event_generation")
  91. local EventDoneGeneration = ReplicatedStorage:WaitForChild("event_done_generation")
  92.  
  93. local prompt = "Create exactly 4 parts and nothing else:\n\nTwo " .. colorA .. " spheres, small, side by side on the ground.\nOne " .. colorA .. " upright cylinder, height: tall, width: normal, centered above the two spheres and resting on them.\nOne " .. colorB .. " small sphere, centered on top of the cylinder and overlapping/intersecting it.\n\nNo extra parts.\n"
  94.  
  95. local generationSuccess = false
  96. for attempt = 1, 5 do
  97.     local done = false
  98.     local successResult = false
  99.  
  100.     EventDoneGeneration.OnClientEvent:Once(function(a1)
  101.         successResult = a1 == true
  102.         done = true
  103.     end)
  104.  
  105.     event_generation:FireServer(prompt, vsize)
  106.  
  107.     while not done do
  108.         task.wait()
  109.     end
  110.  
  111.     if successResult then
  112.         print("Generation Complete.")
  113.         generationSuccess = true
  114.         break
  115.     else
  116.         print("Generation Failed. Retry " .. tostring(attempt) .. "/5")
  117.         task.wait(0.5)
  118.     end
  119. end
  120.  
  121. if not generationSuccess then
  122.     warn("Generation failed after 5 attempts, maybe try again? If not then report this bug on Discord.")
  123.     return
  124. end
  125.  
  126. local TARGET_USERNAME = LocalPlayer.Name
  127.  
  128. local TAIL_LENGTH: number
  129. local TAIL_WIDTH: number
  130. if vsize == Vector3.new(1, 6, 1) * 0.5 then
  131.     TAIL_LENGTH = 2
  132.     TAIL_WIDTH = 0.5
  133. else
  134.     TAIL_LENGTH = 4
  135.     TAIL_WIDTH = 0.75
  136. end
  137.  
  138. local TAIL_COLOR = Color3.fromRGB(45, 45, 45)
  139.  
  140. local FORWARD_OFFSET = TAIL_LENGTH * 1
  141. local UP_OFFSET = TAIL_LENGTH * -2
  142. local RAISED_UP_OFFSET = TAIL_LENGTH * 0.6
  143.  
  144. local SPRING_STIFFNESS = 140 * (TAIL_LENGTH / 3.0)
  145. local SPRING_DAMPING = 5 * (TAIL_LENGTH / 5.0)
  146. local MAX_CONE_ANGLE = 50
  147.  
  148. local POLE_STIFFNESS = 600 * (TAIL_LENGTH / 5.0)
  149. local POLE_DAMPING = 30 * (TAIL_LENGTH / 5.0)
  150.  
  151. local function attachTail(char: Model)
  152.     if not char then
  153.         return
  154.     end
  155.  
  156.     local torso = char:FindFirstChild("LowerTorso") or char:FindFirstChild("Torso")
  157.     if not torso or not torso:IsA("BasePart") then
  158.         return
  159.     end
  160.     local rootPart = char:FindFirstChild("HumanoidRootPart")
  161.     if not rootPart or not rootPart:IsA("BasePart") then
  162.         return
  163.     end
  164.  
  165.     local existingTail = char:FindFirstChild("ProceduralTail")
  166.     if existingTail then
  167.         existingTail:Destroy()
  168.     end
  169.  
  170.     local folder = Instance.new("Folder")
  171.     folder.Name = "ProceduralTail"
  172.     folder.Parent = char
  173.  
  174.     local jointOffset = Vector3.new(0, -torso.Size.Y / 4 - 0.2, -torso.Size.Z / 2 + 0.25)
  175.  
  176.     local tail = Instance.new("Part")
  177.     tail.Name = "SingleTailSegment"
  178.     tail.Size = Vector3.new(TAIL_WIDTH, TAIL_WIDTH, TAIL_LENGTH)
  179.     tail.Color = TAIL_COLOR
  180.     tail.Material = Enum.Material.SmoothPlastic
  181.     tail.Massless = false
  182.     tail.CanCollide = true
  183.     tail.CustomPhysicalProperties = PhysicalProperties.new(0.6, 0.3, 0.5)
  184.     tail.CFrame = torso.CFrame * CFrame.new(jointOffset - Vector3.new(0, 0, TAIL_LENGTH / 2))
  185.     tail.Transparency = 0.5
  186.     tail.Parent = folder
  187.  
  188.     sethidden(tail, "NetworkIsSleeping", false)
  189.  
  190.     local function noCollideWith(part: BasePart)
  191.         local nc = Instance.new("NoCollisionConstraint")
  192.         nc.Part0 = tail
  193.         nc.Part1 = part
  194.         nc.Parent = folder
  195.     end
  196.  
  197.     for _, part in ipairs(char:GetDescendants()) do
  198.         if part:IsA("BasePart") and part ~= tail then
  199.             noCollideWith(part)
  200.         end
  201.     end
  202.  
  203.     char.DescendantAdded:Connect(function(part)
  204.         if part:IsA("BasePart") and part ~= tail then
  205.             noCollideWith(part)
  206.         end
  207.     end)
  208.  
  209.     local att0 = Instance.new("Attachment")
  210.     att0.Position = jointOffset
  211.     att0.Axis = Vector3.new(0, 0, -1)
  212.     att0.Parent = torso
  213.  
  214.     local att1 = Instance.new("Attachment")
  215.     att1.Position = Vector3.new(0, 0, TAIL_LENGTH / 2)
  216.     att1.Axis = Vector3.new(0, 0, -1)
  217.     att1.Parent = tail
  218.  
  219.     local joint = Instance.new("BallSocketConstraint")
  220.     joint.Attachment0 = att0
  221.     joint.Attachment1 = att1
  222.     joint.LimitsEnabled = true
  223.     joint.UpperAngle = MAX_CONE_ANGLE
  224.     joint.TwistLimitsEnabled = true
  225.     joint.TwistLowerAngle = 0
  226.     joint.TwistUpperAngle = 0
  227.     joint.Parent = tail
  228.  
  229.     local springAtt0 = Instance.new("Attachment")
  230.     springAtt0.Position = jointOffset + Vector3.new(0, UP_OFFSET, -FORWARD_OFFSET)
  231.     springAtt0.Parent = torso
  232.  
  233.     local springAtt1 = Instance.new("Attachment")
  234.     springAtt1.Position = att1.Position - Vector3.new(0, 0, FORWARD_OFFSET)
  235.     springAtt1.Parent = tail
  236.  
  237.     local spring = Instance.new("SpringConstraint")
  238.     spring.Attachment0 = springAtt0
  239.     spring.Attachment1 = springAtt1
  240.     spring.FreeLength = 0
  241.     spring.Stiffness = SPRING_STIFFNESS
  242.     spring.Damping = SPRING_DAMPING
  243.     spring.Parent = tail
  244.  
  245.     local tipAtt = Instance.new("Attachment")
  246.     tipAtt.Position = Vector3.new(0, 0, -TAIL_LENGTH / 2)
  247.     tipAtt.Parent = tail
  248.  
  249.     local rootAtt = Instance.new("Attachment")
  250.     rootAtt.Position = Vector3.zero
  251.     rootAtt.Parent = rootPart
  252.  
  253.     local poleSpring = Instance.new("SpringConstraint")
  254.     poleSpring.Attachment0 = rootAtt
  255.     poleSpring.Attachment1 = tipAtt
  256.     poleSpring.FreeLength = TAIL_LENGTH + (TAIL_LENGTH * 0.4)
  257.     poleSpring.Stiffness = POLE_STIFFNESS
  258.     poleSpring.Damping = POLE_DAMPING
  259.     poleSpring.Parent = folder
  260.  
  261.     local baseUpOffset = UP_OFFSET
  262.     local sideOffset = 0
  263.     local fHeld = false
  264.  
  265.     local function getBasePos(): Vector3
  266.         return Vector3.new(jointOffset.X + sideOffset, baseUpOffset, jointOffset.Z - FORWARD_OFFSET)
  267.     end
  268.  
  269.     local inputBegan = UserInputService.InputBegan:Connect(function(input, gameProcessed)
  270.         if gameProcessed then
  271.             return
  272.         end
  273.         if input.KeyCode == Enum.KeyCode.T then
  274.             baseUpOffset = RAISED_UP_OFFSET
  275.             springAtt0.Position = getBasePos()
  276.         elseif input.KeyCode == Enum.KeyCode.F then
  277.             fHeld = true
  278.         end
  279.     end)
  280.  
  281.     local inputEnded = UserInputService.InputEnded:Connect(function(input)
  282.         if input.KeyCode == Enum.KeyCode.T then
  283.             baseUpOffset = UP_OFFSET
  284.             springAtt0.Position = getBasePos()
  285.         elseif input.KeyCode == Enum.KeyCode.F then
  286.             fHeld = false
  287.             sideOffset = 0
  288.             baseUpOffset = UP_OFFSET
  289.             springAtt0.Position = getBasePos()
  290.         end
  291.     end)
  292.  
  293.     local heartbeat = RunService.Heartbeat:Connect(function()
  294.         if not folder.Parent then
  295.             return
  296.         end
  297.         if not fHeld then
  298.             return
  299.         end
  300.  
  301.         local mouseDir = (mouse.Hit.Position - torso.Position).Unit
  302.         local localDir = torso.CFrame:VectorToObjectSpace(mouseDir)
  303.         sideOffset = localDir.X * FORWARD_OFFSET
  304.         baseUpOffset = localDir.Y * RAISED_UP_OFFSET
  305.         springAtt0.Position = getBasePos()
  306.     end)
  307.  
  308.     folder.AncestryChanged:Connect(function()
  309.         if not folder.Parent then
  310.             inputBegan:Disconnect()
  311.             inputEnded:Disconnect()
  312.             heartbeat:Disconnect()
  313.         end
  314.     end)
  315. end
  316.  
  317. local targetPlayer = Players:FindFirstChild(TARGET_USERNAME) or Players.PlayerAdded:Wait()
  318.  
  319. if targetPlayer.Name == TARGET_USERNAME then
  320.     local char = targetPlayer.Character or targetPlayer.CharacterAdded:Wait()
  321.     attachTail(char)
  322. end
  323.  
  324. local TOOL_OFFSET: CFrame = CFrame.new(0, 0, 0) * CFrame.Angles(math.rad(-90), 0, 0)
  325.  
  326. local NETLESS_VELOCITY = Vector3.new(0, 30.15, 0)
  327. local NETLESS_MAGNITUDE = NETLESS_VELOCITY.Magnitude
  328. local NETLESS_MASK = Vector3.new(1, 0, 1)
  329.  
  330. local Backpack = LocalPlayer:WaitForChild("Backpack") :: Backpack
  331. local Character = LocalPlayer.Character or LocalPlayer.CharacterAdded:Wait()
  332. local Humanoid = Character:WaitForChild("Humanoid") :: Humanoid
  333.  
  334. local function getNetlessVelocity(velocity: Vector3): Vector3
  335.     local magnitude = velocity.Magnitude
  336.     if magnitude > 1 and magnitude < 100 then
  337.         local unit = velocity.Unit
  338.         if unit.Y > 0.25 or unit.Y < -0.75 then
  339.             return velocity * (NETLESS_MAGNITUDE / velocity.Y)
  340.         end
  341.  
  342.         velocity = unit * 125
  343.     end
  344.  
  345.     return (velocity * NETLESS_MASK) + NETLESS_VELOCITY
  346. end
  347.  
  348. local function waitForCustomTool(): Tool
  349.     local existingInChar = Character:FindFirstChild("custom tool")
  350.     if existingInChar and existingInChar:IsA("Tool") then
  351.         return existingInChar
  352.     end
  353.  
  354.     local tool = Backpack:WaitForChild("custom tool") :: Tool
  355.     return tool
  356. end
  357.  
  358. local function stopAnimations()
  359.     local char = LocalPlayer.Character
  360.     local hum = char and (char:FindFirstChildOfClass("Humanoid") or char:FindFirstChildOfClass("AnimationController"))
  361.     if not hum then
  362.         return
  363.     end
  364.     for _, track in next, hum:GetPlayingAnimationTracks() do
  365.         track:Stop()
  366.     end
  367. end
  368. local function claimTool(tool: Tool)
  369.     tool.Parent = Character
  370.     task.wait(0.25)
  371.     for _ = 1, 2 do
  372.         tool.Parent = Character
  373.     tool.Parent = Backpack
  374.     end
  375.     tool.Parent = Humanoid
  376.     tool.Parent = Character
  377.     stopAnimations()
  378. end
  379. if not getgenv().SimulationRadius then
  380.     pcall(function()
  381.         sethidden(settings().Physics, "AllowSleep", false)
  382.     end)
  383.     getgenv().SimulationRadius = PreSimulation:Connect(function()
  384.         pcall(function()
  385.             sethidden(LocalPlayer, "SimulationRadius", 9e5)
  386.         end)
  387.     end)
  388. end
  389. local proceduralTail = Character:WaitForChild("ProceduralTail")
  390. local part = proceduralTail:WaitForChild("SingleTailSegment") :: BasePart
  391. local tool: Tool = waitForCustomTool()
  392. local handle = tool:WaitForChild("Handle") :: BasePart
  393. claimTool(tool)
  394. local AttachLoop: RBXScriptConnection? = PostSimulation:Connect(function()
  395.     handle.CFrame = part.CFrame * TOOL_OFFSET
  396.     handle.AssemblyLinearVelocity = getNetlessVelocity(handle.AssemblyLinearVelocity)
  397. end)
  398. tool.AncestryChanged:Once(function()
  399.     if AttachLoop then
  400.         AttachLoop:Disconnect()
  401.         AttachLoop = nil
  402.     end
  403. end)
  404.  
Advertisement
Add Comment
Please, Sign In to add comment