#Crouch System

81 messages · Page 1 of 1 (latest)

tawdry sand
#

im trying to make a crouch system that plays a animation but i dont know how to play the animation the animation would have a walking animation and a idle animation that removes the jump ability

tawdry sand
#

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

tropic flower
#

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)```
tawdry sand
#

oh thank u

tawdry sand
#

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

tropic flower
#
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)
tropic flower
tawdry sand
#

alr also if you play a animation

tropic flower
#

Unless you click on your keys bigbrain

tawdry sand
#

on a local script

#

would

tropic flower
#

Everyone could see it

tawdry sand
#

it be seen by everyone

#

alr

tropic flower
#

yez

tawdry sand
#

thats good

#

also

tawdry sand
#

what would i have to change

#

to

tropic flower
tawdry sand
#

make it left click

tropic flower
#

Wdym "left click"

tawdry sand
#

left click

tropic flower
#

You want to crouch with left click?

tawdry sand
#

on ouse

#

no like

#

i will make a grab scrpt

tropic flower
#

I know what left click is tho...

#

And why tf you want a crouch system for grabbing stuff?

tawdry sand
#

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

tropic flower
#

Check if player's character moves bigbrain

tawdry sand
#

then how do i change the anim

tropic flower
#

Check if player move and if is idle/doenst move then uncrouch ig

tawdry sand
#

i mean

#

there is

#

a anim pausing system

#

@tropic flower

queen kiteBOT
#

studio** You are now Level 9! **studio

tropic flower
#

Dunno

#

Use Roblox Studio Developer Documentation and learn

tawdry sand
#

@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 ?

tropic flower
#

God stop tagging me

tawdry sand
#

sos

#

am just desperate to get the update done for my ppl

pliant saddle
tawdry sand
#

hm

tropic flower
tawdry sand
#

yeah

#

ppl who play ma game

#

the ppl that love my updates

tropic flower
#

Why are you saying that you are gonna make something you cant?

pliant saddle
#

💀

tropic flower
smoky panther
#

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

tawdry sand
#

i found a way