#Crouch System
81 messages · Page 1 of 1 (latest)
anyone?
local userinput = game:GetService("UserInputService")
local active = false
userinput.InputBegan:Connect(function(input, gameprocessed)
if not gameprocessed then
if input.UserInputType == Enum.UserInputType.Keyboard then
local key = input.KeyCode
if key == Enum.KeyCode.C then
if active == false then
local Event = script.Parent.CrouchEvent
Event:FireServer()
active = true
elseif active == true then
local Event = script.Parent.UnCrouchEvent
Event:FireServer()
active = false
end
end
end
end
end)
and also how do i make it so if you click you do a anim
Get the player humanoid (it can be done in a local script) and by using "LoadAnimation" you can simply add an animation for humanoid
humanoid:LoadAnimation(YOUR_ANIMATION)```
oh thank u
also in that way ^^^
how
do i make it
so
if you click
it plays a animation?
@tropic flower ?
like idk what to do to make it detect user input click
local userinput = game:GetService("UserInputService")
local plr = game.Players.LocalPlayer
local character = plr.Character or plr.CharacterAdded:Wait()
local humanoid = character:WaitForChild("Humanoid")
local crouch = false
userinput.InputBegan:Connect(function(input, gameprocessed)
if not gameprocessed and input.UserInputType == Enum.UserInputType.Keyboard and input.KeyCode == Enum.KeyCode.C and crouch == false then
crouch = true
humanoid:LoadAnimation(YOUR_ANIMATION)
end
end)
userinput.InputEnded:Connect(function(input, gameprocessed)
if not gameprocessed and input.UserInputType == Enum.UserInputType.Keyboard and input.KeyCode == Enum.KeyCode.C and crouch == true then
crouch = false
humanoid:LoadAnimation(YOUR_ANIMATION)
end
end)
User input "press", because you are pressing a key, not clicking it
alr also if you play a animation
Unless you click on your keys 
Everyone could see it
yez
in that code ^^^
what would i have to change
to

make it left click
Wdym "left click"
left click
You want to crouch with left click?
I know what left click is tho...
And why tf you want a crouch system for grabbing stuff?
infection game
noob infection game
also
@tropic flower
in the crouching how do i make it detect if it is walking
or
idle
because im making 2 crouching anims
Check if player's character moves 
then how do i change the anim
Check if player move and if is idle/doenst move then uncrouch ig
** You are now Level 9! **
@tropic flower where do i put the code?
like
where do i put the script
also
can u change the code to a left click aswell so i can make a grab?
@tropic flower ?
God stop tagging me
hm
"your people"?
Why are you saying that you are gonna make something you cant?
so many hopes and dreams crushed
💀
use cad
if u want mobile support
u can get the player speed and play an animation if over 0 and idle anim if 0
its pretty basic
i found a way