Baconcoder

pop test

Jun 29th, 2025
45
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.75 KB | None | 0 0
  1. local Players = game:GetService("Players")
  2. local localPlayer = Players.LocalPlayer
  3. local UserInputService = game:GetService("UserInputService")
  4.  
  5. local function createBrownPart(parent, hrp)
  6. local part = Instance.new("Part")
  7. part.Size = Vector3.new(1, 1, 1)
  8. part.Color = Color3.fromRGB(101, 67, 33) -- brown color
  9. part.Material = Enum.Material.Wood
  10. part.Anchored = false
  11. part.CanCollide = false
  12. part.CFrame = hrp.CFrame * CFrame.new(0, -1, -2) -- in front & below
  13. part.Parent = parent
  14.  
  15. -- Weld to HumanoidRootPart to move with player
  16. local weld = Instance.new("WeldConstraint")
  17. weld.Part0 = hrp
  18. weld.Part1 = part
  19. weld.Parent = part
  20.  
  21. -- Optional: remove part after 10 seconds
  22. game.Debris:AddItem(part, 10)
  23.  
  24. return part
  25. end
  26.  
  27. local function squatCharacter(humanoid)
  28. -- Set crouch animation by lowering HipHeight or using SetState if supported
  29. -- Roblox default humanoid has no built-in crouch, so we'll lower HipHeight
  30. local originalHipHeight = humanoid.HipHeight
  31. humanoid.HipHeight = originalHipHeight / 2 -- squat down
  32. -- Restore after 8 seconds
  33. delay(8, function()
  34. if humanoid then
  35. humanoid.HipHeight = originalHipHeight
  36. end
  37. end)
  38. end
  39.  
  40. -- Listen to chat messages locally
  41. localPlayer.Chatted:Connect(function(message)
  42. if message == "Oh man it's coming" then
  43. local character = localPlayer.Character
  44. if not character then return end
  45. local humanoid = character:FindFirstChildOfClass("Humanoid")
  46. local hrp = character:FindFirstChild("HumanoidRootPart")
  47. if not humanoid or not hrp then return end
  48.  
  49. squatCharacter(humanoid)
  50. createBrownPart(character, hrp)
  51. end
  52. end)
  53.  
Advertisement
Add Comment
Please, Sign In to add comment