Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local Players = game:GetService("Players")
- local localPlayer = Players.LocalPlayer
- local UserInputService = game:GetService("UserInputService")
- local function createBrownPart(parent, hrp)
- local part = Instance.new("Part")
- part.Size = Vector3.new(1, 1, 1)
- part.Color = Color3.fromRGB(101, 67, 33) -- brown color
- part.Material = Enum.Material.Wood
- part.Anchored = false
- part.CanCollide = false
- part.CFrame = hrp.CFrame * CFrame.new(0, -1, -2) -- in front & below
- part.Parent = parent
- -- Weld to HumanoidRootPart to move with player
- local weld = Instance.new("WeldConstraint")
- weld.Part0 = hrp
- weld.Part1 = part
- weld.Parent = part
- -- Optional: remove part after 10 seconds
- game.Debris:AddItem(part, 10)
- return part
- end
- local function squatCharacter(humanoid)
- -- Set crouch animation by lowering HipHeight or using SetState if supported
- -- Roblox default humanoid has no built-in crouch, so we'll lower HipHeight
- local originalHipHeight = humanoid.HipHeight
- humanoid.HipHeight = originalHipHeight / 2 -- squat down
- -- Restore after 8 seconds
- delay(8, function()
- if humanoid then
- humanoid.HipHeight = originalHipHeight
- end
- end)
- end
- -- Listen to chat messages locally
- localPlayer.Chatted:Connect(function(message)
- if message == "Oh man it's coming" then
- local character = localPlayer.Character
- if not character then return end
- local humanoid = character:FindFirstChildOfClass("Humanoid")
- local hrp = character:FindFirstChild("HumanoidRootPart")
- if not humanoid or not hrp then return end
- squatCharacter(humanoid)
- createBrownPart(character, hrp)
- end
- end)
Advertisement
Add Comment
Please, Sign In to add comment