3 months ago

How to create a crouch localscript in StarterPlayer.StarterCharacterScripts in article >_<

(make it so that the player can't move if u want :<)


local UserInputService = game:GetService("UserInputService")

local Players = game:GetService("Players")

local player = Players.LocalPlayer

local character = player.Character or player.CharacterAdded:Wait()

local humanoid = character:WaitForChild("Humanoid")

local crouching = false

local normalWalkSpeed = 16

local crouchWalkSpeed = 8

local crouchAnimation = Instance.new("Animation")

crouchAnimation.AnimationId = "rbxassetid://CROUCHANIMATIONID"

local crouchTrack = humanoid:LoadAnimation(crouchAnimation)

UserInputService.InputBegan:Connect(function(input, gameProcessed)

if gameProcessed then return end

if input.KeyCode == Enum.KeyCode.C then

crouching = not crouching

if crouching then

humanoid.WalkSpeed = crouchWalkSpeed

crouchTrack:Play()

else

humanoid.WalkSpeed = normalWalkSpeed

crouchTrack:Stop()

end

end

end)



0 comments

Loading...

Next up

Made a crouch script

I can't stop larping

Can't stop larping

Anton lundin!!!

Came back after months just to make this lol

Bandana Dee the Dream Friend

🍒Did you like the game? A demo is available for free on Steam.

✌️ Thanks for playing IndieGameiacs!

⚙️ Free Demo: http://bit.ly/UniDuni

📺 Full Video: https://youtu.be/5qEbVXg7GaQ

#steam #uniduni #clops #screenshotsaturday

Another house i made long time ago.

What do you think guys in my robot?Just a beginner in 3d modeling..

My instagram https://www.instagram.com/rojhonbb/